symfony API

sfComponent Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

sfComponent.

Inheritence

sfAction, sfComponents  <  sfComponent

Method Summary

  • mixed &($key)
    Gets a variable for the template.
  • debugMessage($message)
    Displays a message as a short message in the sfWebDebug toolbar.
  • mixed execute($request)
    Execute any application/business logic for this component.
  • string generateUrl(, , )
    Generates a URL for the given route and arguments.
  • string getActionName()
    Gets the action name associated with this component.
  • sfContext getContext()
    Retrieves the current application context.
  • sfController getController()
    Retrieves the current sfController object.
  • sfLogger getLogger()
    Retrieves the current logger instance.
  • sfMailer getMailer()
    Gets the current mailer instance.
  • string getModuleName()
    Gets the module name associated with this component.
  • sfRequest getRequest()
    Retrieves the current sfRequest object.
  • string getRequestParameter($name, $default)
    Returns the value of a request parameter.
  • sfResponse getResponse()
    Retrieves the current sfResponse object.
  • sfUser getUser()
    Retrieves the current sfUser object.
  • mixed getVar($name)
    Gets a variable set for the template.
  • sfParameterHolder getVarHolder()
    Gets the sfParameterHolder object that stores the template variables.
  • boolean hasRequestParameter($name)
    Returns true if a request parameter exists.
  • boolean initialize($context, $moduleName, $actionName)
    Initializes this component.
  • logMessage($message, $priority)
    Logs a message using the sfLogger object.
  • setVar($name, $value, $safe)
    Sets a variable for the template.
  • mixed __call($method, $arguments)
    Calls methods defined via sfEventDispatcher.
  • __construct()
    Class constructor.
  • boolean __isset($name)
    Returns true if a variable for the template is set.
  • boolean __set($key, $value)
    Sets a variable for the template.
  • __unset($name)
    Removes a variable for the template.

Method Details

  • (mixed) & ($key) Browse code

    $key The variable name

    Gets a variable for the template.


    This is a shortcut for:

    $this->getVar('name')

    returns The variable value

  • debugMessage ($message) Browse code

    $message The message text

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

  • (mixed) execute ($request) Browse code

    $request The current sfRequest object

    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) generateUrl (, , ) Browse code

    Generates a URL for the given route and arguments.


    This is a proxy method equivalent to:

    $this->getContext()->getRouting()->generate(...)

    returns The URL

  • (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

  • (sfLogger) getLogger () Browse code

    Retrieves the current logger instance.

    returns The current sfLogger instance

  • (sfMailer) getMailer () Browse code

    Gets the current mailer instance.

    returns A sfMailer instance

  • (string) getModuleName () Browse code

    Gets the module name associated with this component.

    returns A module name

  • (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 ($name, $default) Browse code

    $name The parameter name
    $default The default value if parameter does not exist

    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 ($name) Browse code

    $name The variable name

    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) hasRequestParameter ($name) Browse code

    $name The parameter name

    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 ($context, $moduleName, $actionName) Browse code

    $context The current application context.
    $moduleName The module name.
    $actionName The action name.

    Initializes this component.

    returns true, if initialization completes successfully, otherwise false

  • logMessage ($message, $priority) Browse code

    $message String or object containing the message to log
    $priority The priority of the message (available priorities: emerg, alert, crit, err, warning, notice, info, debug)

    Logs a message using the sfLogger object.

  • setVar ($name, $value, $safe) Browse code

    $name The variable name
    $value The variable value
    $safe true if the value is safe for output (false by default)

    Sets a variable for the template.


    If you add a safe value, the variable won't be output escaped
    by symfony, so this is your responsability to ensure that the
    value is escaped properly.

  • (mixed) __call ($method, $arguments) Browse code

    $method The method name
    $arguments The method arguments

    Calls methods defined via sfEventDispatcher.

    returns The returned value of the called method

    throws sfException If called method is undefined

  • __construct () Browse code

    Class constructor.

  • (boolean) __isset ($name) Browse code

    $name The variable name

    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 ($key, $value) Browse code

    $key The variable name
    $value The variable value

    Sets a variable for the template.


    This is a shortcut for:

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

    returns always true

  • __unset ($name) Browse code

    $name The variable Name

    Removes a variable for the template.


    This is just really a shortcut for:

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