[ Index ]
 

Code source de Symfony 1.0.0

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

title

Body

[fermer]

/lib/action/ -> sfAction.class.php (sommaire)

sfAction executes all the logic for the current request.

Author: Fabien Potencier <fabien.potencier@symfony-project.com>
Author: Sean Kerr <skerr@mojavi.org>
Version: SVN: $Id: sfAction.class.php 3209 2007-01-10 08:37:24Z fabien $
Poids: 453 lignes (12 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 27 fonctions

  initialize()
  preExecute()
  postExecute()
  forward404()
  forward404Unless()
  forward404If()
  redirect404()
  forward()
  forwardIf()
  forwardUnless()
  redirect()
  redirectIf()
  redirectUnless()
  renderText()
  getDefaultView()
  getRequestMethods()
  handleError()
  validate()
  getSecurityConfiguration()
  setSecurityConfiguration()
  isSecure()
  getCredential()
  setTemplate()
  getTemplate()
  setLayout()
  getLayout()
  setViewClass()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

initialize($context)   X-Ref
Initializes this action.

param: sfContext The current application context.
return: bool true, if initialization completes successfully, otherwise false

preExecute()   X-Ref
Executes an application defined process prior to execution of this sfAction object.

By default, this method is empty.

postExecute()   X-Ref
Execute an application defined process immediately after execution of this sfAction object.

By default, this method is empty.

forward404($message = '')   X-Ref
Forwards current action to the default 404 error action.

param: string Message of the generated exception

forward404Unless($condition, $message = '')   X-Ref
Forwards current action to the default 404 error action unless the specified condition is true.

param: bool A condition that evaluates to true or false
param: string Message of the generated exception

forward404If($condition, $message = '')   X-Ref
Forwards current action to the default 404 error action if the specified condition is true.

param: bool A condition that evaluates to true or false
param: string Message of the generated exception

redirect404()   X-Ref
Redirects current action to the default 404 error action (with browser redirection).

This method stops the current code flow.


forward($module, $action)   X-Ref
Forwards current action to a new one (without browser redirection).

This method stops the action. So, no code is executed after a call to this method.

param: string A module name
param: string An action name

forwardIf($condition, $module, $action)   X-Ref
If the condition is true, forwards current action to a new one (without browser redirection).

This method stops the action. So, no code is executed after a call to this method.

param: bool   A condition that evaluates to true or false
param: string A module name
param: string An action name

forwardUnless($condition, $module, $action)   X-Ref
Unless the condition is true, forwards current action to a new one (without browser redirection).

This method stops the action. So, no code is executed after a call to this method.

param: bool   A condition that evaluates to true or false
param: string A module name
param: string An action name

redirect($url, $statusCode = 302)   X-Ref
Redirects current request to a new URL.

2 URL formats are accepted :
- a full URL: http://www.google.com/
- an internal URL (url_for() format): module/action

This method stops the action. So, no code is executed after a call to this method.

param: string Url
param: string Status code (default to 302)

redirectIf($condition, $url)   X-Ref
Redirects current request to a new URL, only if specified condition is true.

This method stops the action. So, no code is executed after a call to this method.

param: bool   A condition that evaluates to true or false
param: string url

redirectUnless($condition, $url)   X-Ref
Redirects current request to a new URL, unless specified condition is true.

This method stops the action. So, no code is executed after a call to this method.

param: bool   A condition that evaluates to true or false
param: string Url

renderText($text)   X-Ref
Appends the given text to the response content and bypasses the built-in view system.

This method must be called as with a return:

<code>return $this->renderText('some text')</code>

param: string Text to append to the response
return: sfView::NONE

getDefaultView()   X-Ref
Retrieves the default view to be executed when a given request is not served by this action.

return: string A string containing the view name associated with this action

getRequestMethods()   X-Ref
Retrieves the request methods on which this action will process validation and execution.

return: int One of the following values:

handleError()   X-Ref
Executes any post-validation error application logic.

return: string A string containing the view name associated with this action

validate()   X-Ref
Validates manually files and parameters.

return: bool true, if validation completes successfully, otherwise false.

getSecurityConfiguration()   X-Ref
Returns the security configuration for this module.

return: string Current security configuration as an array

setSecurityConfiguration($security)   X-Ref
Overrides the current security configuration for this module.

param: array The new security configuration

isSecure()   X-Ref
Indicates that this action requires security.

return: bool true, if this action requires security, otherwise false.

getCredential()   X-Ref
Gets credentials the user must have to access this action.

return: mixed An array or a string describing the credentials the user must have to access this action

setTemplate($name)   X-Ref
Sets an alternate template for this sfAction.

See 'Naming Conventions' in the 'Symfony View' documentation.

param: string Template name

getTemplate()   X-Ref
Gets the name of the alternate template for this sfAction.

WARNING: It only returns the template you set with the setTemplate() method,
and does not return the template that you configured in your view.yml.

See 'Naming Conventions' in the 'Symfony View' documentation.

return: string Template name. Returns null if no template has been set within the action

setLayout($name)   X-Ref
Sets an alternate layout for this sfAction.

To de-activate the layout, set the layout name to false.

To revert the layout to the one configured in the view.yml, set the template name to null.

param: mixed Layout name or false to de-activate the layout

getLayout()   X-Ref
Gets the name of the alternate layout for this sfAction.

WARNING: It only returns the layout you set with the setLayout() method,
and does not return the layout that you configured in your view.yml.

return: mixed Layout name. Returns null if no layout has been set within the action

setViewClass($class)   X-Ref
Changes the default view class used for rendering the template associated with the current action.

param: string View class name



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7