Forward/redirect in a component 

http://www.symfony-project.org/forum/index.php?t=msg&th=8417

> Is there a possibility to forward or redirect in an action defined in
> components.class.php?

Nope. A component is called by an action, and only an action proper can do a redirect. This limitation does make sense: if a component could do a redirect it would interrupt the rendering of the template halfway through - inefficient and inelegant.

As it happens, I've tackled this very problem recently. I've put my component in a plugin, and in the plugin I also offer a static method to capture POST events from the action. This looks a bit like this:

<?php
class MyPostHandler
{
  public static function execute($action)
  {
    if (POST)
    {
      if (other tests)
      {
        $action->redirect(...);
      }
    }
  }
}
?>

Then I do this in my action:

<?php
MyPostHandler::execute($this);
?>

documented on: 29 August 2007, halfer