symfony API

sfController 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:

sfController directs application flow.

Inheritence

sfWebController, sfConsoleController  <  sfController

Method Summary

  • bool actionExists($moduleName, $actionName)
    Indicates whether or not a module has a specific action.
  • bool componentExists($moduleName, $componentName)
    Indicates whether or not a module has a specific component.
  • boolean controllerExists($moduleName, $controllerName, $extension, $throwExceptions)
    Looks for a controller and optionally throw exceptions if existence is required (i.e.
  • forward($moduleName, $actionName)
    Forwards the request to another action.
  • sfAction getAction($moduleName, $actionName)
    Retrieves an sfAction implementation instance.
  • sfActionStack getActionStack()
    Retrieves the action stack.
  • sfComponent getComponent($moduleName, $componentName)
    Retrieves a sfComponent implementation instance.
  • object getController($moduleName, $controllerName, $extension)
    Retrieves a controller implementation instance.
  • string getPresentationFor($module, $action, $viewName)
    Returns the rendered view presentation of a given module/action.
  • int getRenderMode()
    Retrieves the presentation rendering mode.
  • sfView getView($moduleName, $actionName, $viewName)
    Retrieves a sfView implementation instance.
  • bool inCLI()
    Indicates whether or not we were called using the CLI version of PHP.
  • initialize($context)
    Initializes this controller.
  • string sendEmail($module, $action)
    [DEPRECATED] Sends and email.
  • true setRenderMode($mode)
    Sets the presentation rendering mode.
  • mixed __call($method, $arguments)
    Calls methods defined via sfEventDispatcher.
  • __construct()
    Class constructor.

Method Details

  • (bool) actionExists ($moduleName, $actionName) Browse code

    $moduleName A module name
    $actionName An action name

    Indicates whether or not a module has a specific action.

    returns true, if the action exists, otherwise false

  • (bool) componentExists ($moduleName, $componentName) Browse code

    $moduleName A module name
    $componentName An component name

    Indicates whether or not a module has a specific component.

    returns true, if the component exists, otherwise false

  • (boolean) controllerExists ($moduleName, $controllerName, $extension, $throwExceptions) Browse code

    $moduleName The name of the module
    $controllerName The name of the controller within the module
    $extension Either 'action' or 'component' depending on the type of controller to look for
    $throwExceptions Whether to throw exceptions if the controller doesn't exist

    Looks for a controller and optionally throw exceptions if existence is required (i.e.

    in the case of {@link getController()}).

    returns true if the controller exists, false otherwise

    throws sfConfigurationException thrown if the module is not enabled

  • forward ($moduleName, $actionName) Browse code

    $moduleName A module name
    $actionName An action name

    Forwards the request to another action.

    throws sfConfigurationException If an invalid configuration setting has been found

  • (sfAction) getAction ($moduleName, $actionName) Browse code

    $moduleName A module name
    $actionName An action name

    Retrieves an sfAction implementation instance.

    returns An sfAction implementation instance, if the action exists, otherwise null

  • (sfActionStack) getActionStack () Browse code

    Retrieves the action stack.

    returns An sfActionStack instance, if the action stack is enabled, otherwise null

  • (sfComponent) getComponent ($moduleName, $componentName) Browse code

    $moduleName A module name
    $componentName A component name

    Retrieves a sfComponent implementation instance.

    returns A sfComponent implementation instance, if the component exists, otherwise null

  • (object) getController ($moduleName, $controllerName, $extension) Browse code

    $moduleName A module name
    $controllerName A component name
    $extension Either 'action' or 'component' depending on the type of controller to look for

    Retrieves a controller implementation instance.

    returns A controller implementation instance, if the controller exists, otherwise null

  • (string) getPresentationFor ($module, $action, $viewName) Browse code

    $module A module name
    $action An action name
    $viewName A View class name

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

    returns The generated content

  • (int) getRenderMode () Browse code

    Retrieves the presentation rendering mode.

    returns One of the following: - sfView::RENDER_CLIENT - sfView::RENDER_VAR

  • (sfView) getView ($moduleName, $actionName, $viewName) Browse code

    $moduleName A module name
    $actionName An action name
    $viewName A view name

    Retrieves a sfView implementation instance.

    returns A sfView implementation instance, if the view exists, otherwise null

  • (bool) inCLI () Browse code

    Indicates whether or not we were called using the CLI version of PHP.

    returns true, if using cli, otherwise false.

  • initialize ($context) Browse code

    $context A sfContext implementation instance

    Initializes this controller.

  • (string) sendEmail ($module, $action) Browse code

    $module A module name
    $action An action name

    [DEPRECATED] Sends and email.


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

    returns The generated mail content

  • (true) setRenderMode ($mode) Browse code

    $mode A rendering mode one of the following: - sfView::RENDER_CLIENT - sfView::RENDER_VAR - sfView::RENDER_NONE

    Sets the presentation rendering mode.

    throws sfRenderException If an invalid render mode has been set

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

  • __construct () Browse code

    Class constructor.