symfony API

sfView Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

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

A view represents the presentation layer of an action. Output can be

Inheritence

sfPHPView  <  sfView

Method Summary

  • configure()
    Configures template.
  • execute()
    Executes any presentation logic and set template attributes.
  • string getActionName()
    Gets the action name associated with this view.
  • mixed getAttribute($name, $default)
    Retrieves an attribute for the current view.
  • sfParameterHolder getAttributeHolder()
    Retrieves attributes for the current view.
  • array getComponentSlot($name)
    Gets a component slot
  • string getDecoratorDirectory()
    Retrieves this views decorator template directory.
  • string getDecoratorTemplate()
    Retrieves this views decorator template.
  • string getDirectory()
    Retrieves this view template directory.
  • mixed getEngine()
    Retrieves the template engine associated with this view.
  • string getExtension()
    Retrieves the current view extension.
  • string getModuleName()
    Gets the module name associated with this view.
  • mixed getParameter($name, $default)
    Retrieves a parameter from the current view.
  • sfParameterHolder getParameterHolder()
    Retrieves the parameters for the current view.
  • string getTemplate()
    Retrieves this views template.
  • string getViewName()
    Gets the view name associated with this view.
  • mixed hasAttribute($name)
    Returns true if the view have attributes.
  • bool hasComponentSlot($name)
    Indicates whether or not a component slot exists.
  • bool hasParameter($name)
    Indicates whether or not a parameter exist for the current view.
  • bool initialize($context, $moduleName, $actionName, $viewName)
    Initializes this view.
  • initializeAttributeHolder()
  • bool isDecorator()
    Indicates that this view is a decorating view.
  • preRenderCheck()
    Executes a basic pre-render check to verify all required variables exist
  • string render()
    Renders the presentation.
  • setAttribute($name, $value)
    Sets an attribute of the view.
  • setComponentSlot($attributeName, $moduleName, $componentName)
    Sets the module and action to be executed in place of a particular template attribute.
  • setDecorator($boolean)
    Sets the decorating mode for the current view.
  • setDecoratorDirectory($directory)
    Sets the decorator template directory for this view.
  • setDecoratorTemplate($template)
    Sets the decorator template for this view.
  • setDirectory($directory)
    Sets the template directory for this view.
  • setExtension($extension)
    Sets an extension for the current view.
  • setParameter($name, $value)
    Sets a parameter for the view.
  • setTemplate($template)
    Sets the template for this view.
  • mixed __call($method, $arguments)
    Calls methods defined via sfEventDispatcher.
  • __construct()
    Class constructor.

Method Details

  • configure () Browse code

    Configures template.

  • execute () Browse code

    Executes any presentation logic and set template attributes.

  • (string) getActionName () Browse code

    Gets the action name associated with this view.

    returns An action name

  • (mixed) getAttribute ($name, $default) Browse code

    $name Name of the attribute
    $default Value of the attribute

    Retrieves an attribute for the current view.

    returns Attribute

  • (sfParameterHolder) getAttributeHolder () Browse code

    Retrieves attributes for the current view.

    returns The attribute parameter holder

  • (array) getComponentSlot ($name) Browse code

    $name The component slot name

    Gets a component slot

    returns The component slot

  • (string) getDecoratorDirectory () Browse code

    Retrieves this views decorator template directory.

    returns An absolute filesystem path to this views decorator template directory

  • (string) getDecoratorTemplate () Browse code

    Retrieves this views decorator template.

    returns A template filename, if a template has been set, otherwise null

  • (string) getDirectory () Browse code

    Retrieves this view template directory.

    returns An absolute filesystem path to this views template directory

  • (mixed) getEngine () Browse code

    Retrieves the template engine associated with this view.


    Note: This will return null for PHPView instances.

    returns A template engine instance

  • (string) getExtension () Browse code

    Retrieves the current view extension.

    returns The extension for current view.

  • (string) getModuleName () Browse code

    Gets the module name associated with this view.

    returns A module name

  • (mixed) getParameter ($name, $default) Browse code

    $name Parameter name
    $default Default parameter value

    Retrieves a parameter from the current view.

    returns A parameter value

  • (sfParameterHolder) getParameterHolder () Browse code

    Retrieves the parameters for the current view.

    returns The parameter holder

  • (string) getTemplate () Browse code

    Retrieves this views template.

    returns A template filename, if a template has been set, otherwise null

  • (string) getViewName () Browse code

    Gets the view name associated with this view.

    returns An action name

  • (mixed) hasAttribute ($name) Browse code

    $name Name of the attribute

    Returns true if the view have attributes.

    returns Attribute of the view

  • (bool) hasComponentSlot ($name) Browse code

    $name The component slot name

    Indicates whether or not a component slot exists.

    returns true, if the component slot exists, otherwise false

  • (bool) hasParameter ($name) Browse code

    $name Name of the parameter

    Indicates whether or not a parameter exist for the current view.

    returns true, if the parameter exists otherwise false

  • (bool) initialize ($context, $moduleName, $actionName, $viewName) Browse code

    $context The current application context
    $moduleName The module name for this view
    $actionName The action name for this view
    $viewName The view name

    Initializes this view.

    returns true, if initialization completes successfully, otherwise false

  • initializeAttributeHolder () Browse code

  • (bool) isDecorator () Browse code

    Indicates that this view is a decorating view.

    returns true, if this view is a decorating view, otherwise false

  • preRenderCheck () Browse code

    Executes a basic pre-render check to verify all required variables exist

    and that the template is readable.

    throws sfRenderException If the pre-render check fails

  • (string) render () Browse code

    Renders the presentation.

    returns A string representing the rendered presentation

  • setAttribute ($name, $value) Browse code

    $name Attribute name
    $value Value for the attribute

    Sets an attribute of the view.

  • setComponentSlot ($attributeName, $moduleName, $componentName) Browse code

    $attributeName A template attribute name
    $moduleName A module name
    $componentName A component name

    Sets the module and action to be executed in place of a particular template attribute.

  • setDecorator ($boolean) Browse code

    $boolean Set the decorating mode for the view

    Sets the decorating mode for the current view.

  • setDecoratorDirectory ($directory) Browse code

    $directory An absolute filesystem path to a template directory

    Sets the decorator template directory for this view.

  • setDecoratorTemplate ($template) Browse code

    $template An absolute or relative filesystem path to a template

    Sets the decorator template for this view.


    If the template path is relative, it will be based on the currently
    executing module's template sub-directory.

  • setDirectory ($directory) Browse code

    $directory An absolute filesystem path to a template directory

    Sets the template directory for this view.

  • setExtension ($extension) Browse code

    $extension The extension name.

    Sets an extension for the current view.

  • setParameter ($name, $value) Browse code

    $name Name of the parameter
    $value The parameter value

    Sets a parameter for the view.

  • setTemplate ($template) Browse code

    $template An absolute or relative filesystem path to a template

    Sets the template for this view.


    If the template path is relative, it will be based on the currently
    executing module's template sub-directory.

  • (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 the calls fails

  • __construct () Browse code

    Class constructor.