如何在Zend Framework的控制器的postDispatch方法中分配视图变量?
答案 0 :(得分:1)
class Your_Class extends Zend_Controller_Plugin_Abstract
{
public function postDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMvcInstance();
$view = $layout->getView();
$view->variable = 'some value';
}
}