On Sat, 2011-01-01 at 23:36 -0800, benze wrote:
> Hi,
> 
> I'm trying to figure out the best way to reuse an action, and am
> having difficulty figuring that out.  Specifically because my action
> seems to be tied to the response.
> 
> For instance, I have a delete action that I want to call from within
> several different web pages, however, depending on which page is
> calling the delete action, I want to redirect the user to a different
> page once complete.  I'm not quite sure if/how to do that.
> 

You have three possibilities of obtaining the data needed to decide
where to redirect. One is the URL(different routes into the action), the
second is the get/post data(redirect_to token), and the third is the
session/db. Here's an example of n1 working:

// In the action

$route_name = $this->getContext()->getRouting()->getCurrentRouteName();
switch($route_name) {
  case 'route_1':
    $this->redirect('to_1');
...
}


I don't know what you meant by the java stuff. Workflow is controlled by
the filters and action already. You could have a redirection filter
working after the execution filter that sets what to redirect to.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to