cakephp-2.0 > Object :: requestAction()
A AbstractTransport AclBehavior AclComponent AclInterface AclNode AclShell Aco AcoAction ActionsAuthorize ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel AppShell Aro AuthComponent B BadRequestException BakeShell BakeTask BaseAuthenticate BaseAuthorize BasicAuthenticate BasicAuthentication BehaviorCollection C Cache CacheEngine CacheException CacheHelper CacheSession CakeEmail CakeErrorController CakeException CakeLog CakeLogException CakeLogInterface CakePlugin CakeRequest CakeResponse CakeRoute CakeSchema CakeSession CakeSessionException CakeSessionHandlerInterface CakeSocket ClassRegistry CommandListShell Component ComponentCollection ConfigReaderInterface Configure ConfigureException ConnectionManager ConsoleErrorHandler ConsoleException ConsoleInput ConsoleInputArgument ConsoleInputOption ConsoleInputSubcommand ConsoleOptionParser ConsoleOutput ConsoleShell ContainableBehavior Controller ControllerAuthorize ControllerTask CookieComponent CrudAuthorize D DatabaseSession DataSource DbAcl DbAclSchema DbConfigTask DboSource Debugger DebugTransport DigestAuthenticate DigestAuthentication Dispatcher E EmailComponent ErrorHandler ExceptionRenderer ExtractTask F File FileEngine FileLog FixtureTask Folder ForbiddenException FormAuthenticate FormHelper H Helper HelperCollection HelpFormatter HtmlHelper HttpException HttpResponse HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniReader InternalErrorException J JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MailTransport MediaView MemcacheEngine MethodNotAllowedException MissingActionException MissingBehaviorException MissingComponentException MissingConnectionException MissingControllerException MissingDatabaseException MissingDatasourceConfigException MissingDatasourceException MissingHelperException MissingLayoutException MissingModelException MissingPluginException MissingShellException MissingShellMethodException MissingTableException MissingTaskException MissingTestLoaderException MissingViewException Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte Mysql N NotFoundException NumberHelper O Object ObjectCollection P PagesController PagesController PaginatorComponent PaginatorHelper Permission PhpReader PluginShortRoute PluginTask Postgres PrivateActionException ProjectTask PrototypeEngineHelper R RedirectRoute RequestHandlerComponent Router RouterException RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher SmtpTransport SocketException Sqlite Sqlserver String T TaskCollection TemplateTask TestsuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior U UnauthorizedException UpgradeShell V Validation View ViewTask W WincacheEngine X XcacheEngine Xml XmlException

requestAction

line:73 at /lib/Cake/Core/Object.php
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

(mixed) public requestAction ($url, $extra = array())

Parameters

ParameterTypeCommentDefault
$url mixed required String or array-based url. Unlike other url arrays in CakePHP, this url will not automatically handle passed and named arguments in the $url parameter.
$extra array optional if array includes the key "return" it sets the AutoRender to true. Can also be used to submit GET/POST data, and named/passed arguments. array()

Return

mixed

Comment

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()

#### Passing POST and GET data

POST and GET data can be simulated in requestAction. Use `$extra['url']` for
GET data. The `$extra['data']` parameter allows POST data simulation.

@param mixed $url String or array-based url. Unlike other url arrays in CakePHP, this
url will not automatically handle passed and named arguments in the $url parameter.
@param array $extra if array includes the key "return" it sets the AutoRender to true. Can
also be used to submit GET/POST data, and named/passed arguments.
@return mixed Boolean true or false on success/failure, or contents
of rendered action if 'return' is set in $extra.