Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have first to add in <code>generator.yml</code> your <code>save_and_back_to_list</code> and other custom <code>my_other_action</code> actions:</p> <pre><code> config: actions: ~ fields: ~ list: ~ filter: ~ form: ~ edit: actions: _save: ~ _list: ~ save_and_back_to_list: ~ my_other_action: ~ new: actions: _save: ~ _save_and_add: ~ _list: ~ save_and_back_to_list: ~ my_other_action: ~ </code></pre> <p>Then you have to add your customized helper functions to create your buttons in <code>/apps/myapplication/modules/mymodule/lib/mymoduleGeneratorHelper.class.php</code></p> <pre><code> public function linkToSaveAndBackToList($object, $params) { return '&lt;li class="sf_admin_action_save_and_back_to_list"&gt;&lt;input type="submit" value="'.__($params['label'], array(), 'sf_admin').'" name="save_and_back_to_list" /&gt;&lt;/li&gt;'; } public function linkToMyOtherAction($object, $params) { return '&lt;li class="sf_admin_action_my_other_action"&gt;&lt;input type="submit" value="'.__($params['label'], array(), 'sf_admin').'" name="my_other_action" /&gt;&lt;/li&gt;'; } </code></pre> <p>Now you get two submit buttons both in <code>New</code> and <code>Edit</code> form.</p> <p>Finally you have to override the function <code>processForm(sfWebRequest $request, sfForm $form)</code>, that you can find in <code>/cache/dev/modules/autoMymodule/actions/actions.class.php</code>, to manage your new submit actions. I guess your <code>create</code> function overrides the admin generator one.</p> <p>I hope I don't forget nothing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload