Reputation: 99
I have trouble redirecting an object (or routing object) from an action to another action.
my actions file:
protected function example(...){
...
$object = Doctrine::getTable('object')->findOneById(1); //for example
...
//dunno how to pass $object to executeShow
$url = $this->generateUrl('object_show', array('sf_subject' => $object));
$this->redirect($url);
public function executeShow(sfWebRequest $request){
$this->object = $this->getRoute()->getObject();
...
}
Upvotes: 0
Views: 4627
Reputation: 99
Got it:
protected function example(...){
...
$object = Doctrine::getTable('object')->findOneById(1); //for example
...
//this worked :)
$this->getRequest()->setParameter('sf_subject', $object);
$this->forward('module', 'show');
}
public function executeShow(sfWebRequest $request){
$this->object = $this->getRoute()->getObject();
...
}
Upvotes: 2