Inheritance diagram for Controller:

Public Member Functions | |
| __construct () | |
| __mergeVars () | |
| _afterScaffoldSave ($method) | |
| _afterScaffoldSaveError ($method) | |
| _beforeScaffold ($method) | |
| _scaffoldError ($method) | |
| afterFilter () | |
| beforeFilter () | |
| beforeRender () | |
| constructClasses () | |
| disableCache () | |
| flash ($message, $url, $pause=1) | |
| header ($status) | |
| isAuthorized () | |
| loadModel ($modelClass=null, $id=null) | |
| paginate ($object=null, $scope=array(), $whitelist=array()) | |
| postConditions ($data=array(), $op=null, $bool= 'AND', $exclusive=false) | |
| redirect ($url, $status=null, $exit=true) | |
| referer ($default=null, $local=false) | |
| render ($action=null, $layout=null, $file=null) | |
| set ($one, $two=null) | |
| setAction ($action) | |
| validate () | |
| validateErrors () | |
Public Attributes | |
| $action = null | |
| $autoLayout = true | |
| $autoRender = true | |
| $base = null | |
| $cacheAction = false | |
| $Component = null | |
| $components = array() | |
| $data = array() | |
| $ext = '.ctp' | |
| $helpers = array('Html', 'Form') | |
| $here = null | |
| $layout = 'default' | |
| $layoutPath = null | |
| $methods = array() | |
| $modelClass = null | |
| $modelKey = null | |
| $modelNames = array() | |
| $name = null | |
| $output = null | |
| $pageTitle = false | |
| $paginate = array('limit' => 20, 'page' => 1) | |
| $params = array() | |
| $passedArgs = array() | |
| $persistModel = false | |
| $plugin = null | |
| $scaffold = false | |
| $uses = false | |
| $validationErrors = null | |
| $view = 'View' | |
| $viewPath = null | |
| $viewVars = array() | |
| $webroot = null | |
Definition at line 41 of file controller.php.
| Controller::__construct | ( | ) |
Constructor.
Reimplemented from Object.
Reimplemented in CakeErrorController.
Definition at line 324 of file controller.php.
References __(), __construct(), classify(), name(), and underscore().
| Controller::__mergeVars | ( | ) |
Merge components, helpers, and uses vars from AppController and PluginAppController.
Definition at line 359 of file controller.php.
References $plugin, $uses, camelize(), Set::merge(), Set::normalize(), and uses().
Referenced by constructClasses().
| Controller::_afterScaffoldSave | ( | $ | method | ) |
This method should be overridden in child classes.
| string | $method name of method called either edit or update. |
Definition at line 1150 of file controller.php.
| Controller::_afterScaffoldSaveError | ( | $ | method | ) |
This method should be overridden in child classes.
| string | $method name of method called either edit or update. |
Definition at line 1161 of file controller.php.
| Controller::_beforeScaffold | ( | $ | method | ) |
This method should be overridden in child classes.
| string | $method name of method called example index, edit, etc. |
Definition at line 1139 of file controller.php.
| Controller::_scaffoldError | ( | $ | method | ) |
This method should be overridden in child classes. If not it will render a scaffold error. Method MUST return true in child classes
| string | $method name of method called example index, edit, etc. |
Definition at line 1174 of file controller.php.
| Controller::afterFilter | ( | ) |
Called after the controller action is run and rendered.
public http://book.cakephp.org/view/60/Callbacks
Definition at line 1129 of file controller.php.
| Controller::beforeFilter | ( | ) |
Called before the controller action.
public http://book.cakephp.org/view/60/Callbacks
Definition at line 1113 of file controller.php.
| Controller::beforeRender | ( | ) |
Called after the controller action is run, but before the view is rendered.
public http://book.cakephp.org/view/60/Callbacks
Definition at line 1121 of file controller.php.
Referenced by render().
| Controller::constructClasses | ( | ) |
Loads Model classes based on the the uses property see Controller::loadModel(); for more info. Loads Components and prepares them for initialization.
Definition at line 440 of file controller.php.
References $id, $modelClass, $plugin, $uses, __mergeVars(), loadModel(), and uses().
Referenced by CakeErrorController::__construct().
| Controller::disableCache | ( | ) |
Forces the user's browser not to cache the results of the current request.
Definition at line 843 of file controller.php.
References header().
| Controller::flash | ( | $ | message, | |
| $ | url, | |||
| $ | pause = 1 | |||
| ) |
Shows a message to the user for $pause seconds, then redirects to $url. Uses flash.ctp as the default layout for the message. Does not work if the current debug level is higher than 0.
| string | $message Message to display to the user | |
| mixed | $url Relative string or array-based URL to redirect to after the time expires | |
| integer | $pause Time to show the message |
Definition at line 862 of file controller.php.
References $url, render(), set(), and Router::url().
| Controller::header | ( | $ | status | ) |
Convenience method for header()
| string | $status |
Definition at line 643 of file controller.php.
Referenced by disableCache(), and redirect().
| Controller::isAuthorized | ( | ) |
Controller callback to tie into Auth component. Only called when AuthComponent::authorize is set to 'controller'.
Definition at line 706 of file controller.php.
References __().
| Controller::loadModel | ( | $ | modelClass = null, |
|
| $ | id = null | |||
| ) |
Loads and instantiates models required by this controller. If Controller::persistModel; is true, controller will create cached model instances on first request, additional request will used cached models. If the model is non existent, it will throw a missing database table error, as Cake generates dynamic models for the time being.
| string | $modelClass Name of model class to load | |
| mixed | $id Initial ID the instanced model class should have |
Definition at line 479 of file controller.php.
References $id, $modelClass, $plugin, Object::_persist(), Object::cakeError(), ClassRegistry::getInstance(), ClassRegistry::init(), and uses().
Referenced by constructClasses().
| Controller::paginate | ( | $ | object = null, |
|
| $ | scope = array(), |
|||
| $ | whitelist = array() | |||
| ) |
Handles automatic pagination of model records.
| mixed | $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel') | |
| mixed | $scope Conditions to use while paginating | |
| array | $whitelist List of allowed options for paging |
Definition at line 934 of file controller.php.
References $name, __(), name(), order, params(), and uses().
| Controller::postConditions | ( | $ | data = array(), |
|
| $ | op = null, |
|||
| $ | bool = 'AND', |
|||
| $ | exclusive = false | |||
| ) |
Converts POST'ed form data to a model conditions array, suitable for use in a Model::find() call.
| array | $data POST'ed data organized by model and field | |
| mixed | $op A string containing an SQL comparison operator, or an array matching operators to fields | |
| string | $bool SQL boolean operator: AND, OR, XOR, etc. | |
| boolean | $exclusive If true, and $op is an array, fields not included in $op will not be included in the returned conditions |
Definition at line 881 of file controller.php.
References $data.
| Controller::redirect | ( | $ | url, | |
| $ | status = null, |
|||
| $ | exit = true | |||
| ) |
Redirects to given $url, after turning off $this->autoRender. Script execution is halted after the redirect.
| mixed | $url A string or array-based URL pointing to another location within the app, or an absolute URL | |
| integer | $status Optional HTTP status code (eg: 404) | |
| boolean | $exit If true, exit() will be called after the redirect |
Definition at line 536 of file controller.php.
References $url, Object::_stop(), header(), and Router::url().
Referenced by PagesController::display().
| Controller::referer | ( | $ | default = null, |
|
| $ | local = false | |||
| ) |
Returns the referring URL for this request.
| string | $default Default URL to use if HTTP_REFERER cannot be read from headers | |
| boolean | $local If true, restrict referring URLs to local server |
Definition at line 816 of file controller.php.
| Controller::render | ( | $ | action = null, |
|
| $ | layout = null, |
|||
| $ | file = null | |||
| ) |
Instantiates the correct view class, hands it its data, and uses it to render the view output.
| string | $action Action name to render | |
| string | $layout Layout to use | |
| string | $file File to use for rendering |
Definition at line 759 of file controller.php.
References $action, $layout, $plugin, beforeRender(), camelize(), ClassRegistry::getObject(), App::import(), ClassRegistry::isKeySet(), ClassRegistry::keys(), params(), Configure::read(), set(), and underscore().
Referenced by PagesController::display(), and flash().
| Controller::set | ( | $ | one, | |
| $ | two = null | |||
| ) |
Saves a variable for use inside a view template.
| mixed | $one A string or an array of data. | |
| mixed | $two Value in case $one is a string (which then works as the key). Unused if $one is an associative array, otherwise serves as the values to $one's keys. |
Definition at line 656 of file controller.php.
References $data, $name, and variable().
Referenced by PagesController::display(), flash(), and render().
| Controller::setAction | ( | $ | action | ) |
Internally redirects one action to another. Examples:
setAction('another_action'); setAction('action_with_parameters', $parameter1);
| string | $action The new action to be redirected to | |
| mixed | Any other parameters passed to this method will be passed as parameters to the new action. |
Definition at line 693 of file controller.php.
References $action.
| Controller::validate | ( | ) |
Returns number of errors in a submitted FORM.
Definition at line 716 of file controller.php.
References validateErrors().
| Controller::validateErrors | ( | ) |
Validates models passed by parameters. Example:
$errors = $this->validateErrors($this->Article, $this->User);
| mixed | A list of models as a variable argument |
Definition at line 734 of file controller.php.
Referenced by validate().
| Controller::$action = null |
| Controller::$autoLayout = true |
Definition at line 195 of file controller.php.
| Controller::$autoRender = true |
Definition at line 188 of file controller.php.
| Controller::$base = null |
| Controller::$cacheAction = false |
Definition at line 261 of file controller.php.
| Controller::$Component = null |
Definition at line 202 of file controller.php.
| Controller::$components = array() |
| Controller::$data = array() |
| Controller::$ext = '.ctp' |
Definition at line 227 of file controller.php.
| Controller::$helpers = array('Html', 'Form') |
| Controller::$here = null |
Definition at line 56 of file controller.php.
| Controller::$layout = 'default' |
| Controller::$layoutPath = null |
Definition at line 140 of file controller.php.
| Controller::$methods = array() |
Definition at line 293 of file controller.php.
| Controller::$modelClass = null |
| Controller::$modelKey = null |
Definition at line 312 of file controller.php.
| Controller::$modelNames = array() |
Definition at line 163 of file controller.php.
| Controller::$name = null |
Reimplemented in PagesController, and CakeErrorController.
Definition at line 49 of file controller.php.
Referenced by paginate(), and set().
| Controller::$output = null |
Definition at line 236 of file controller.php.
| Controller::$pageTitle = false |
Definition at line 156 of file controller.php.
| Controller::$paginate = array('limit' => 20, 'page' => 1) |
Definition at line 126 of file controller.php.
| Controller::$params = array() |
Definition at line 100 of file controller.php.
| Controller::$passedArgs = array() |
Definition at line 277 of file controller.php.
| Controller::$persistModel = false |
Definition at line 270 of file controller.php.
| Controller::$plugin = null |
Definition at line 243 of file controller.php.
Referenced by __mergeVars(), constructClasses(), loadModel(), and render().
| Controller::$scaffold = false |
Definition at line 285 of file controller.php.
| Controller::$uses = false |
Reimplemented in PagesController, and CakeErrorController.
Definition at line 80 of file controller.php.
Referenced by __mergeVars(), and constructClasses().
| Controller::$validationErrors = null |
Definition at line 319 of file controller.php.
| Controller::$view = 'View' |
Definition at line 220 of file controller.php.
| Controller::$viewPath = null |
Definition at line 133 of file controller.php.
| Controller::$viewVars = array() |
Definition at line 147 of file controller.php.
| Controller::$webroot = null |
Definition at line 63 of file controller.php.
1.4.7