[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/libs/controller/ -> controller.php (sommaire)

Base controller class. PHP versions 4 and 5

Copyright: Copyright 2005-2007, Cake Software Foundation, Inc.
License: http://www.opensource.org/licenses/mit-license.php The MIT License
Version: $Revision: 4409 $
Poids: 989 lignes (30 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Controller:: (25 méthodes):
  __construct()
  _initComponents()
  constructClasses()
  redirect()
  set()
  setAction()
  validate()
  validateErrors()
  render()
  referer()
  _setArray()
  _setTitle()
  flash()
  flashOut()
  generateFieldNames()
  postConditions()
  cleanUpFields()
  beforeFilter()
  beforeRender()
  afterFilter()
  _beforeScaffold()
  _afterScaffoldSave()
  _afterScaffoldSaveError()
  _scaffoldError()
  _selectedArray()


Classe: Controller  - X-Ref

Controller

Application controller (controllers are where you put all the actual code)
Provides basic functionality, such as rendering views (aka displaying templates).
Automatically selects model name from on singularized object class name
and creates the model object if proper class exists.

__construct()   X-Ref
Constructor.


_initComponents()   X-Ref
Pas de description

constructClasses()   X-Ref
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

return: mixed true when single model found and instance created error returned if models not found.

redirect($url, $status = null)   X-Ref
Redirects to given $url, after turning off $this->autoRender.
Please notice that the script execution is not stopped after the redirect.

param: string $url
param: integer $status

set($one, $two = null)   X-Ref
Saves a variable to use inside a template.

param: mixed $one A string or an array of data.
param: 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.
return: mixed string or array of variables set

setAction($action)   X-Ref
Internally redirects one action to another

param: string $action The new action to be redirected to
param: mixed  Any other parameters passed to this method will be passed as

validate()   X-Ref
Returns number of errors in a submitted FORM.

return: int Number of errors

validateErrors()   X-Ref
Validates a FORM according to the rules set up in the Model.

return: int Number of errors

render($action = null, $layout = null, $file = null)   X-Ref
Gets an instance of the view object and prepares it for rendering the output, then
asks the view to actualy do the job.

param: string $action
param: string $layout
param: string $file
return: controllers related views

referer($default = null, $local = false)   X-Ref
Gets the referring URL of this request

param: string $default Default URL to use if HTTP_REFERER cannot be read from headers
param: boolean $local If true, restrict referring URLs to local server

_setArray($data)   X-Ref
Sets data for this view. Will set title if the key "title" is in given $data array.

param: array $data Array of

_setTitle($pageTitle)   X-Ref
Set the title element of the page.

param: string $pageTitle Text for the title

flash($message, $url, $pause = 1)   X-Ref
Shows a message to the user $time seconds, then redirects to $url
Uses flash.thtml as a layout for the messages

param: string $message Message to display to the user
param: string $url Relative URL to redirect to after the time expires
param: int $time seconds to show the message

flashOut($message, $url, $pause = 1)   X-Ref
Replaced with Controller::flash();


generateFieldNames($data = null, $doCreateOptions = true)   X-Ref
This function creates a $fieldNames array for the view to use.

param: array $data
param: boolean $doCreateOptions
return: field name arrays for the view

postConditions($data)   X-Ref
Converts POST'ed model data to a model conditions array, suitable for a find or findAll Model query

param: array $data POST'ed data organized by model and field
return: array An array of model conditions

cleanUpFields($modelName = null)   X-Ref
Cleans up the date fields of current Model.

param: string $modelName

beforeFilter()   X-Ref
Called before the controller action.  Overridden in subclasses.


beforeRender()   X-Ref
Called after the controller action is run, but before the view is rendered.  Overridden in subclasses.


afterFilter()   X-Ref
Called after the controller action is run and rendered.  Overridden in subclasses.


_beforeScaffold($method)   X-Ref
This method should be overridden in child classes.

param: string $method name of method called example index, edit, etc.
return: boolean

_afterScaffoldSave($method)   X-Ref
This method should be overridden in child classes.

param: string $method name of method called either edit or update.
return: boolean

_afterScaffoldSaveError($method)   X-Ref
This method should be overridden in child classes.

param: string $method name of method called either edit or update.
return: boolean

_scaffoldError($method)   X-Ref
This method should be overridden in child classes.
If not it will render a scaffold error.
Method MUST return true in child classes

param: string $method name of method called example index, edit, etc.
return: boolean

_selectedArray($data, $key = 'id')   X-Ref
Used to convert HABTM data into an array for selectTag

param: array $data
param: string $key
return: array



Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7