Thank you Myke,
I know this, and in fact I can accomplish the same by adding an action
in my generator.yml
But my problem is how to handle the redirect after the save is done by
executeEdit() in generated actions.class.php
_save_and_add action is handled specially by the admin generator
template code. I can add special handling for add_and_list as well, but
I was wondering if there were a more general way of handling addition of
custom edit actions
Myke Hines wrote:
> Haris,
> All you need to do is create a file in your template directory
> named: _edit_actions.php
>
> include the following code:
>
> <ul class="sf_admin_actions">
> <?php $editActions = $this->getParameterValue('edit.actions') ?>
> <?php if (null !== $editActions): ?>
> <?php foreach ((array) $editActions as $actionName => $params): ?>
> <?php if ($actionName == '_delete') continue ?>
> <?php echo
> $this->addCredentialCondition($this->getButtonToAction($actionName,
> $params, true), $params) ?>
> <?php endforeach; ?>
> <?php else: ?>
> <?php echo $this->getButtonToAction('_list', array(), true) ?>
> <?php echo $this->getButtonToAction('_save', array(), true) ?>
> <?php echo $this->getButtonToAction('_save_and_list', array(), true) ?>
> <?php echo $this->getButtonToAction('_save_and_add', array(), true) ?>
> <?php endif; ?>
> </ul>
>
>
> This is basically copying the existing template and adding the following line:
> <?php echo $this->getButtonToAction('_save_and_list', array(), true) ?>
>
>
> hope that helps,
> myke
>
> On 7/30/07, Myke Hines <[EMAIL PROTECTED]> wrote:
>
>> On 7/30/07, Haris Zukanović <[EMAIL PROTECTED]> wrote:
>>
>>> In the admin generator, how would I make an action button in an edit
>>> page just like save_and_add, but to do redirect to a page of my choice?
>>> For example I would like to make a button that does
>>> save and go back to the list
>>>
>>> This seems to be difficult because admin generator makes a default
>>> redirect after a successfull save, it redirs to the edit page for the
>>> same object
>>>
>>>
>>> TIA
>>>
>>> --
>>> Haris Zukanovic
>>> CEO
>>> Software development and research
>>> International Business Development, SOFTING ltd.
>>>
>>>
>>> office +387 36 318 339
>>> GSM +387 61 839 069
>>>
>>> http://www.eu-softing.com
>>>
>>>
>>>
>>>
>>>
>>> CONFIDENTIALITY NOTICE
>>> This e-mail and any attached files, sent by a company e - mail system,
>>> contains company confidential and/or privileged information and is intended
>>> only for the person or entity to which it is addressed and only for the
>>> purposes therein set forth. If you are not the intended recipient (or have
>>> received this e-mail in error) please notify the sender immediately and
>>> destroy this e-mail. Any unauthorized copying, disclosure, distribution or
>>> other use of, or taking of any action in reliance upon, the material in
>>> this e-mail by persons or entities other than the intended recipient is
>>> strictly forbidden.
>>>
>>>
>>>
>
> >
>
--
Haris Zukanovic
CEO
Software development and research
International Business Development, SOFTING ltd.
office +387 36 318 339
GSM +387 61 839 069
http://www.eu-softing.com
CONFIDENTIALITY NOTICE
This e-mail and any attached files, sent by a company e - mail system, contains
company confidential and/or privileged information and is intended only for the
person or entity to which it is addressed and only for the purposes therein set
forth. If you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure, distribution or other use of, or taking of
any action in reliance upon, the material in this e-mail by persons or entities
other than the intended recipient is strictly forbidden.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---