anyone can tell me, how to pass arguments in cakephp $this->requestAction(...)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
requestAction(string $url, array $options)
This function calls a controller's action from any location and returns data from the action. The $url passed is a CakePHP-relative URL (/controllername/actionname/params)
. To pass extra data to the receiving controller action add to the $options array.
# echo $this->requestAction('/articles/view/5');
回答2:
Try this way:
$url = Router::url(array( 'controller' => 'Foo', 'action' => 'edit', 3 )); $this->requestAction($url);