Controller Class Reference

Public Member Functions | |
| _afterScaffoldSave ($method) | |
| _afterScaffoldSaveError ($method) | |
| _beforeScaffold ($method) | |
| _initComponents () | |
| _scaffoldError ($method) | |
| _selectedArray ($data, $key= 'id') | |
| _setArray ($data) | |
| _setTitle ($pageTitle) | |
| afterFilter () | |
| beforeFilter () | |
| beforeRender () | |
| cleanUpFields ($modelName=null) | |
| constructClasses () | |
| flash ($message, $url, $pause=1) | |
| flashOut ($message, $url, $pause=1) | |
| generateFieldNames ($data=null, $doCreateOptions=true) | |
| postConditions ($data) | |
| redirect ($url, $status=null) | |
| 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 | |
| $beforeFilter = null | |
| $cacheAction = false | |
| $components = array() | |
| $data = array() | |
| $ext = '.thtml' | |
| $helpers = array('Html') | |
| $here = null | |
| $layout = 'default' | |
| $modelNames = array() | |
| $name = null | |
| $output = null | |
| $pageTitle = false | |
| $params = array() | |
| $persistModel = false | |
| $plugin = null | |
| $uses = false | |
| $view = 'View' | |
| $viewPath = null | |
| $viewVars = array() | |
| $webroot = null | |
| $webservices = null | |
Detailed Description
Definition at line 43 of file controller.php.
Member Function Documentation
| Controller::_afterScaffoldSave | ( | $ | method | ) |
This method should be overridden in child classes.
- Parameters:
-
string $method name of method called either edit or update.
- Returns:
- boolean protected
Definition at line 955 of file controller.php.
| Controller::_afterScaffoldSaveError | ( | $ | method | ) |
This method should be overridden in child classes.
- Parameters:
-
string $method name of method called either edit or update.
- Returns:
- boolean protected
Definition at line 965 of file controller.php.
| Controller::_beforeScaffold | ( | $ | method | ) |
This method should be overridden in child classes.
- Parameters:
-
string $method name of method called example index, edit, etc.
- Returns:
- boolean protected
Definition at line 945 of file controller.php.
| Controller::_initComponents | ( | ) |
Definition at line 269 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
- Parameters:
-
string $method name of method called example index, edit, etc.
- Returns:
- boolean protected
Definition at line 977 of file controller.php.
| Controller::_selectedArray | ( | $ | data, | |
| $ | key = 'id' | |||
| ) |
Used to convert HABTM data into an array for selectTag
- Parameters:
-
array $data string $key
- Returns:
- array protected
Definition at line 988 of file controller.php.
References $data.
| Controller::_setArray | ( | $ | data | ) |
Sets data for this view. Will set title if the key "title" is in given $data array.
- Parameters:
-
array $data Array of protected
Definition at line 591 of file controller.php.
References $data, $name, and _setTitle().
Referenced by set().
| Controller::_setTitle | ( | $ | pageTitle | ) |
Set the title element of the page.
- Parameters:
-
string $pageTitle Text for the title private
Definition at line 606 of file controller.php.
References $pageTitle.
Referenced by _setArray().
| Controller::afterFilter | ( | ) |
Called after the controller action is run and rendered. Overridden in subclasses.
public
Definition at line 936 of file controller.php.
| Controller::beforeFilter | ( | ) |
Called before the controller action. Overridden in subclasses.
public
Definition at line 922 of file controller.php.
| Controller::beforeRender | ( | ) |
Called after the controller action is run, but before the view is rendered. Overridden in subclasses.
public
Definition at line 929 of file controller.php.
Referenced by render().
| Controller::cleanUpFields | ( | $ | modelName = null |
) |
Cleans up the date fields of current Model.
- Parameters:
-
string $modelName public
Definition at line 859 of file controller.php.
| Controller::constructClasses | ( | ) |
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
- Returns:
- mixed true when single model found and instance created error returned if models not found. public
Definition at line 281 of file controller.php.
References $uses, Object::_persist(), Object::cakeError(), ClassRegistry::getInstance(), and Inflector::underscore().
| Controller::flash | ( | $ | message, | |
| $ | url, | |||
| $ | pause = 1 | |||
| ) |
Shows a message to the user $time seconds, then redirects to $url if DEBUG == 0. If DEBUG > 0, warnings and SQL output may halt redirection. Uses flash.thtml as a layout for the messages
- Parameters:
-
string $message Message to display to the user string $url Relative URL to redirect to after the time expires int $time seconds to show the message public
Definition at line 618 of file controller.php.
References render().
Referenced by flashOut().
| Controller::flashOut | ( | $ | message, | |
| $ | url, | |||
| $ | pause = 1 | |||
| ) |
Replaced with Controller::flash();
- Deprecated:
- will not be avialable after 1.1.x.x
Definition at line 636 of file controller.php.
| Controller::generateFieldNames | ( | $ | data = null, |
|
| $ | doCreateOptions = true | |||
| ) |
This function creates a $fieldNames array for the view to use.
- Parameters:
-
array $data boolean $doCreateOptions
- Returns:
- field name arrays for the view public
Definition at line 659 of file controller.php.
References $data, ClassRegistry::getObject(), Inflector::humanize(), Inflector::pluralize(), and Inflector::underscore().
| Controller::postConditions | ( | $ | data | ) |
Converts POST'ed model data to a model conditions array, suitable for a find or findAll Model query
- Parameters:
-
array $data POST'ed data organized by model and field
- Returns:
- array An array of model conditions public
Definition at line 840 of file controller.php.
References $data.
| Controller::redirect | ( | $ | url, | |
| $ | status = null | |||
| ) |
Redirects to given $url, after turning off $this->autoRender. Please notice that the script execution is not stopped after the redirect.
- Parameters:
-
string $url integer $status public
Definition at line 376 of file controller.php.
Referenced by PagesController::display().
| Controller::referer | ( | $ | default = null, |
|
| $ | local = false | |||
| ) |
Gets the referring URL of this request
- Parameters:
-
string $default Default URL to use if HTTP_REFERER cannot be read from headers boolean $local If true, restrict referring URLs to local server public
Definition at line 567 of file controller.php.
References $base.
| Controller::render | ( | $ | action = null, |
|
| $ | layout = null, |
|||
| $ | file = null | |||
| ) |
Gets an instance of the view object and prepares it for rendering the output, then asks the view to actualy do the job.
- Parameters:
-
string $action string $layout string $file
- Returns:
- controllers related views public
Definition at line 528 of file controller.php.
References $action, $file, $layout, beforeRender(), Inflector::camelize(), ClassRegistry::getObject(), ClassRegistry::isKeySet(), ClassRegistry::keys(), and Inflector::underscore().
Referenced by PagesController::display(), flash(), and flashOut().
| Controller::set | ( | $ | one, | |
| $ | two = null | |||
| ) |
Saves a variable to use inside a template.
- Parameters:
-
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.
- Returns:
- mixed string or array of variables set public
Definition at line 460 of file controller.php.
References _setArray().
| Controller::setAction | ( | $ | action | ) |
Internally redirects one action to another
- Parameters:
-
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. public
Definition at line 479 of file controller.php.
| Controller::validate | ( | ) |
Returns number of errors in a submitted FORM.
- Returns:
- int Number of errors public
Definition at line 491 of file controller.php.
References $args, and validateErrors().
| Controller::validateErrors | ( | ) |
Validates a FORM according to the rules set up in the Model.
- Returns:
- int Number of errors public
Definition at line 506 of file controller.php.
Referenced by validate().
Member Data Documentation
| Controller::$action = null |
| Controller::$autoLayout = true |
Definition at line 156 of file controller.php.
| Controller::$autoRender = true |
Definition at line 149 of file controller.php.
| Controller::$base = null |
| Controller::$beforeFilter = null |
Replaced with Controller::beforeFilter();
- Deprecated:
- will not be avialable after 1.1.x.x
Definition at line 222 of file controller.php.
| Controller::$cacheAction = false |
Definition at line 207 of file controller.php.
| Controller::$components = array() |
Definition at line 163 of file controller.php.
| Controller::$data = array() |
Definition at line 99 of file controller.php.
Referenced by _selectedArray(), _setArray(), generateFieldNames(), and postConditions().
| Controller::$ext = '.thtml' |
Definition at line 177 of file controller.php.
| Controller::$helpers = array('Html') |
| Controller::$here = null |
Definition at line 57 of file controller.php.
| Controller::$layout = 'default' |
| Controller::$modelNames = array() |
Definition at line 128 of file controller.php.
| Controller::$name = null |
Reimplemented in PagesController.
Definition at line 50 of file controller.php.
Referenced by _setArray().
| Controller::$output = null |
Definition at line 193 of file controller.php.
| Controller::$pageTitle = false |
| Controller::$params = array() |
Definition at line 92 of file controller.php.
| Controller::$persistModel = false |
Definition at line 216 of file controller.php.
| Controller::$plugin = null |
Definition at line 200 of file controller.php.
| Controller::$uses = false |
Reimplemented in PagesController.
Definition at line 78 of file controller.php.
Referenced by constructClasses().
| Controller::$view = 'View' |
Definition at line 170 of file controller.php.
| Controller::$viewPath = null |
Definition at line 107 of file controller.php.
| Controller::$viewVars = array() |
Definition at line 114 of file controller.php.
| Controller::$webroot = null |
Definition at line 64 of file controller.php.
| Controller::$webservices = null |
Replaced with Router::parseExtensions();
- Deprecated:
- will not be avialable after 1.1.x.x
Definition at line 228 of file controller.php.
The documentation for this class was generated from the following file:
- /cake_1.1.19.6305/cake/libs/controller/controller.php