[英]check and passing parameter to view in base controller (afterAction)
for controller i want to do some post checkup after action done, and pass back to view. 对于控制器,我想在操作完成后做一些后期检查,然后传递回查看。
in controller 在控制器中
$this->render('/Company/index', array("linkArray" => $this->linkArray, "input" => $this->input, "data" => $this->data, "lang" => $this->lang));
in controller i already pass $this->data. 在控制器中,我已经传递了$ this-> data。
in base controller i declare following function 在基本控制器中,我声明以下功能
public function afterAction($action) {
$checkData = $this->checkData($action->data);
return parent::afterAction($action);
}
1 . 1。 how can i pass $checkData to view in afterAction(base controller).
我如何传递$ checkData在afterAction(基本控制器)中查看。
2 . 2。 how can i access $this->data in $action and pass to checkdata function.
我如何在$ action中访问$ this-> data并传递给checkdata函数。 i try ->, :: ,[] ,{} all method to access to its property but its fail
我尝试->,::,[],{}所有方法来访问其属性,但失败
Thx and happy new year. 谢谢,新年快乐。
You may have to do this with the beforeRender() function. 您可能必须使用beforeRender()函数执行此操作。
These links may help. 这些链接可能会有所帮助。
http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/ http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/
http://www.yiiframework.com/wiki/54/ http://www.yiiframework.com/wiki/54/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.