Indirect Users

Method Summary

Calls a controller's method from any location. Can be used to connect controllers together
or tie plugins into a main application. requestAction can be used to return rendered views
or fetch the return value from controller actions.

Method Detail

Calls a controller's method from any location. Can be used to connect controllers together
or tie plugins into a main application. requestAction can be used to return rendered views
or fetch the return value from controller actions.

Under the hood this method uses Router::reverse() to convert the $url parameter into a string
URL. You should use URL formats that are compatible with Router::reverse()

Examples

A basic example getting the return value of the controller action:

$variables = $this->requestAction('/articles/popular');

A basic example of request action to fetch a rendered page without the layout.

Passing other request data

You can pass POST, GET, COOKIE and other data into the request using the appropriate keys.
Cookies can be passed using the cookies key. Get parameters can be set with query and post
data can be sent using the post key.