symfony API

sfAction Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.0 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.0 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfAction executes all the logic for the current request.

Inheritence

sfActions  <  sfAction  <  sfComponent

Method Summary

  • forward(, )
    Forwards current action to a new one (without browser redirection).
  • forward404()
    Forwards current action to the default 404 error action.
  • forward404If(, )
    Forwards current action to the default 404 error action if the specified condition is true.
  • forward404Unless(, )
    Forwards current action to the default 404 error action unless the specified condition is true.
  • forwardIf(, , )
    If the condition is true, forwards current action to a new one (without browser redirection).
  • forwardUnless(, , )
    Unless the condition is true, forwards current action to a new one (without browser redirection).
  • mixed getCredential()
    Gets credentials the user must have to access this action.
  • string getDefaultView()
    Retrieves the default view to be executed when a given request is not served by this action.
  • mixed getLayout()
    Gets the name of the alternate layout for this sfAction.
  • int getRequestMethods()
    Retrieves the request methods on which this action will process validation and execution.
  • string getSecurityConfiguration()
    Returns the security configuration for this module.
  • string getTemplate()
    Gets the name of the alternate template for this sfAction.
  • string handleError()
    Executes any post-validation error application logic.
  • bool initialize()
    Initializes this action.
  • bool isSecure()
    Indicates that this action requires security.
  • postExecute()
    Execute an application defined process immediately after execution of this sfAction object.
  • preExecute()
    Executes an application defined process prior to execution of this sfAction object.
  • redirect(, )
    Redirects current request to a new URL.
  • redirect404()
    Redirects current action to the default 404 error action (with browser redirection).
  • redirectIf(, )
    Redirects current request to a new URL, only if specified condition is true.
  • redirectUnless(, )
    Redirects current request to a new URL, unless specified condition is true.
  • sfView::NONE renderText()
    Appends the given text to the response content and bypasses the built-in view system.
  • setLayout()
    Sets an alternate layout for this sfAction.
  • setSecurityConfiguration()
    Overrides the current security configuration for this module.
  • setTemplate()
    Sets an alternate template for this sfAction.
  • setViewClass()
    Changes the default view class used for rendering the template associated with the current action.
  • bool validate()
    Validates manually files and parameters.

Methods inherited from sfComponent

& , debugMessage , execute , getActionName , getContext , getController , getFlash , getLogger , getModuleName , getPresentationFor , getRequest , getRequestParameter , getResponse , getUser , getVar , getVarHolder , hasFlash , hasRequestParameter , initialize , logMessage , sendEmail , setFlash , setVar , __call , __isset , __set , __unset

Method Details

  • forward (, ) Browse code

    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.

    throws sfStopException

  • forward404 () Browse code

    Forwards current action to the default 404 error action.

    throws sfError404Exception

  • forward404If (, ) Browse code

    Forwards current action to the default 404 error action if the specified condition is true.

    throws sfError404Exception

  • forward404Unless (, ) Browse code

    Forwards current action to the default 404 error action unless the specified condition is true.

    throws sfError404Exception

  • forwardIf (, , ) Browse code

    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.

    throws sfStopException

  • forwardUnless (, , ) Browse code

    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.

    throws sfStopException

  • (mixed) getCredential () Browse code

    Gets credentials the user must have to access this action.

    returns An array or a string describing the credentials the user must have to access this action

  • (string) getDefaultView () Browse code

    Retrieves the default view to be executed when a given request is not served by this action.

    returns A string containing the view name associated with this action

  • (mixed) getLayout () Browse code

    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.

    returns Layout name. Returns null if no layout has been set within the action

  • (int) getRequestMethods () Browse code

    Retrieves the request methods on which this action will process validation and execution.

    returns One of the following values: - sfRequest::GET - sfRequest::POST - sfRequest::PUT - sfRequest::DELETE - sfRequest::HEAD - sfRequest::NONE

  • (string) getSecurityConfiguration () Browse code

    Returns the security configuration for this module.

    returns Current security configuration as an array

  • (string) getTemplate () Browse code

    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.

    returns Template name. Returns null if no template has been set within the action

  • (string) handleError () Browse code

    Executes any post-validation error application logic.

    returns A string containing the view name associated with this action

  • (bool) initialize () Browse code

    Initializes this action.

    returns true, if initialization completes successfully, otherwise false

  • (bool) isSecure () Browse code

    Indicates that this action requires security.

    returns true, if this action requires security, otherwise false.

  • postExecute () Browse code

    Execute an application defined process immediately after execution of this sfAction object.


    By default, this method is empty.

  • preExecute () Browse code

    Executes an application defined process prior to execution of this sfAction object.


    By default, this method is empty.

  • redirect (, ) Browse code

    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.

    throws sfStopException

  • redirect404 () Browse code

    Redirects current action to the default 404 error action (with browser redirection).


    This method stops the current code flow.

  • redirectIf (, ) Browse code

    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.

    throws sfStopException

  • redirectUnless (, ) Browse code

    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.

    throws sfStopException

  • (sfView::NONE) renderText () Browse code

    Appends the given text to the response content and bypasses the built-in view system.


    This method must be called as with a return:

    return $this->renderText('some text')

  • setLayout () Browse code

    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.

  • setSecurityConfiguration () Browse code

    Overrides the current security configuration for this module.

  • setTemplate () Browse code

    Sets an alternate template for this sfAction.


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

  • setViewClass () Browse code

    Changes the default view class used for rendering the template associated with the current action.

  • (bool) validate () Browse code

    Validates manually files and parameters.

    returns true, if validation completes successfully, otherwise false.