Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
afterRender()控制器方法调用 after render(),但不是 after renderPartial()。
afterRender()
render()
renderPartial()
有解决办法吗?
调用renderPartial后,保存返回结果,这样调用afterRender:
$view = 'myView'; // etc $output = $this->renderPartial($view, array(...)); $this->afterRender($view, $output);
如果您需要定期执行此操作,请renderPartial在CController课程中覆盖并在那里调用afterRender。
renderPartial
CController
afterRender