symfony API

sfComponent Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

sfComponent.

Inheritence

sfAction, sfComponents  <  sfComponent

Method Summary

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

Method Details

  • __unset ($name)

    $name The variable Name

    Removes a variable for the template.

    This is just really a shortcut for:

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

  • (mixed) getVar ($name)

    $name The variable name

    Gets a variable set for the template.

    returns The variable value

  • __construct ($context, $moduleName, $actionName)

    Class constructor.

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

    $method The method name
    $arguments The method arguments

    Calls methods defined via sfEventDispatcher.

    returns The returned value of the called method

  • logMessage ($message, $priority = &apos;info&apos;)

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

  • (string) getRequestParameter ($name, $default = null)

    $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

  • (mixed) execute ((sfRequest) $request)

    $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) getModuleName ()

    Gets the module name associated with this component.

    returns A module name

  • (boolean) __set ($key, $value)

    $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

  • (boolean) initialize ((sfContext) $context, $moduleName, $actionName)

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

    Initializes this component.

    returns true, if initialization completes successfully, otherwise false

  • getResponse ()

    Retrieves the current sfResponse object.

    This is a proxy method equivalent to:

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

    returns The current sfResponse implementation instance

  • setVar ($name, $value, (Boolean) $safe = false)

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

  • (boolean) hasRequestParameter ($name)

    $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

  • debugMessage ($message)

    $message The message text

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

  • getContext ()

    Retrieves the current application context.

    returns The current sfContext instance

  • (boolean) __isset ($name)

    $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

  • getUser ()

    Retrieves the current sfUser object.

    This is a proxy method equivalent to:

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

    returns The current sfUser implementation instance

  • (mixed&amp;) __get ($key)

    $key The variable name

    Gets a variable for the template.

    This is a shortcut for:

    $this->getVar('name')

    returns The variable value

  • (string) getActionName ()

    Gets the action name associated with this component.

    returns An action name

  • getLogger ()

    Retrieves the current logger instance.

    returns The current sfLogger instance

  • getRequest ()

    Retrieves the current sfRequest object.

    This is a proxy method equivalent to:

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

    returns The current sfRequest implementation instance

  • getVarHolder ()

    Gets the sfParameterHolder object that stores the template variables.

    returns The variable holder.

  • getController ()

    Retrieves the current sfController object.

    This is a proxy method equivalent to:

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

    returns The current sfController implementation instance