symfony API

sfComponent 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.

sfComponent.

Inheritence

sfAction, sfComponents  <  sfComponent

Method Summary

  • mixed &()
    Gets a variable for the template.
  • debugMessage()
    Displays a message as a short message in the sfWebDebug toolbar.
  • mixed execute()
    Execute any application/business logic for this component.
  • string getActionName()
    Gets the action name associated with this component.
  • sfContext getContext()
    Retrieves the current application context.
  • sfController getController()
    Retrieves the current sfController object.
  • mixed getFlash()
    Gets a flash variable.
  • sfLogger getLogger()
    Retrieves the current logger instance.
  • string getModuleName()
    Gets the module name associated with this component.
  • string getPresentationFor(, , )
    Returns the rendered view presentation of a given module/action.
  • sfRequest getRequest()
    Retrieves the current sfRequest object.
  • string getRequestParameter()
    Returns the value of a request parameter.
  • sfResponse getResponse()
    Retrieves the current sfResponse object.
  • sfUser getUser()
    Retrieves the current sfUser object.
  • mixed getVar()
    Gets a variable set for the template.
  • sfParameterHolder getVarHolder()
    Gets the sfParameterHolder object that stores the template variables.
  • boolean hasFlash()
    Returns true if a flash variable of the specified name exists.
  • boolean hasRequestParameter()
    Returns true if a request parameter exists.
  • boolean initialize()
    Initializes this component.
  • logMessage(, )
    Logs a message using the sfLogger object.
  • string sendEmail(, )
    Sends and email from the current action.
  • setFlash(, , )
    Sets a flash variable that will be passed to the very next action.
  • setVar(, )
    Sets a variable for the template.
  • mixed __call(, )
    Calls methods defined via the sfMixer class.
  • boolean __isset()
    Returns true if a variable for the template is set.
  • boolean __set(, )
    Sets a variable for the template.
  • __unset()
    Removes a variable for the template.

Method Details

  • (mixed) & () Browse code

    Gets a variable for the template.


    This is a shortcut for:

    $this->getVar('name')

    returns The variable value

  • debugMessage () Browse code

    Displays a message as a short message in the sfWebDebug toolbar.

  • (mixed) execute () Browse code

    Execute any application/business logic for this component.


    In a typical database-driven application, execute() handles application
    logic itself and then proceeds to create a model instance. Once the model
    instance is initialized it handles all business logic for the action.

    A model should represent an entity in your application. This could be a
    user account, a shopping cart, or even a something as simple as a
    single product.

    returns A string containing the view name associated with this action

  • (string) getActionName () Browse code

    Gets the action name associated with this component.

    returns An action name

  • (sfContext) getContext () Browse code

    Retrieves the current application context.

    returns The current sfContext instance

  • (sfController) getController () Browse code

    Retrieves the current sfController object.


    This is a proxy method equivalent to:

    $this->getContext()->getController()

    returns The current sfController implementation instance

  • (mixed) getFlash () Browse code

    Gets a flash variable.

    returns The value of the flash variable

  • (sfLogger) getLogger () Browse code

    Retrieves the current logger instance.

    returns The current sfLogger instance

  • (string) getModuleName () Browse code

    Gets the module name associated with this component.

    returns A module name

  • (string) getPresentationFor (, , ) Browse code

    Returns the rendered view presentation of a given module/action.


    This is a shortcut for

    $this->getController()->getPresentationFor($module, $action, $viewName)

    returns The generated content

  • (sfRequest) getRequest () Browse code

    Retrieves the current sfRequest object.


    This is a proxy method equivalent to:

    $this->getContext()->getRequest()

    returns The current sfRequest implementation instance

  • (string) getRequestParameter () Browse code

    Returns the value of a request parameter.


    This is a proxy method equivalent to:

    $this->getRequest()->getParameterHolder()->get($name)

    returns The request parameter value

  • (sfResponse) getResponse () Browse code

    Retrieves the current sfResponse object.


    This is a proxy method equivalent to:

    $this->getContext()->getResponse()

    returns The current sfResponse implementation instance

  • (sfUser) getUser () Browse code

    Retrieves the current sfUser object.


    This is a proxy method equivalent to:

    $this->getContext()->getUser()

    returns The current sfUser implementation instance

  • (mixed) getVar () Browse code

    Gets a variable set for the template.

    returns The variable value

  • (sfParameterHolder) getVarHolder () Browse code

    Gets the sfParameterHolder object that stores the template variables.

    returns The variable holder.

  • (boolean) hasFlash () Browse code

    Returns true if a flash variable of the specified name exists.

    returns true if the variable exists, false otherwise

  • (boolean) hasRequestParameter () Browse code

    Returns true if a request parameter exists.


    This is a proxy method equivalent to:

    $this->getRequest()->getParameterHolder()->has($name)

    returns true if the request parameter exists, false otherwise

  • (boolean) initialize () Browse code

    Initializes this component.

    returns true, if initialization completes successfully, otherwise false

  • logMessage (, ) Browse code

    Logs a message using the sfLogger object.

  • (string) sendEmail (, ) Browse code

    Sends and email from the current action.


    This methods calls a module/action with the sfMailView class.

    This is a shortcut for

    $this->getController()->sendEmail($module, $action)

    returns The generated mail content

  • setFlash (, , ) Browse code

    Sets a flash variable that will be passed to the very next action.

  • setVar (, ) Browse code

    Sets a variable for the template.

  • (mixed) __call (, ) Browse code

    Calls methods defined via the sfMixer class.

    returns The returned value of the called method

  • (boolean) __isset () Browse code

    Returns true if a variable for the template is set.


    This is a shortcut for:

    $this->getVarHolder()->has('name')

    returns true if the variable is set

  • (boolean) __set (, ) Browse code

    Sets a variable for the template.


    This is a shortcut for:

    $this->setVar('name', 'value')

    returns always true

  • __unset () Browse code

    Removes a variable for the template.


    This is just really a shortcut for:

    $this->getVarHolder()->remove('name')