我无法将对象(或路由对象)从操作重定向到另一个操作。
我的行动档案:
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();
...
}
答案 0 :(得分:2)
知道了:
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();
...
}