我正在尝试为控制器中的每个操作使用布局。例如,我在索引控制器中有三个操作。这些是indexAction、testAction和welcomeAction。我创建了三个XML布局文件:index.xml、test.xml和welcome.xml。最后,我创建了一个插件。
class Moon_Layout_Append extends Zend_Controller_Plugin_Abstract{
public function preDispatch($request){
$layoutFile = APPLICATION_PATH."/Modules/".$request->module."/layout/".$request->action.".xml";
$layout = new Zend_Config_Xml($layoutFile,'index');
}
}
问题是...我该如何访问布局对象来设置从xml中读取的内容?