symfony API

sfView Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

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.

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.
  • mixed getAttribute(, , )
    Retrieves an attribute for the current view.
  • sfParameterHolder getAttributeHolder()
    Retrieves attributes for the current view.
  • array getComponentSlot()
    Gets a component slot
  • sfContext getContext()
    Retrieves the current application context.
  • 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 getEscaping()
    Gets the default escaping strategy associated with this view.
  • string getEscapingMethod()
    Returns the name of the function that is to be used as the escaping method.
  • string getExtension()
    Retrieves the current view extension.
  • mixed getParameter(, , )
    Retrieves a parameter from the current view.
  • sfParameterHolder getParameterHolder()
    Retrieves the parameters for the current view.
  • string getTemplate()
    Retrieves this views template.
  • mixed hasAttribute(, )
    Returns true if the view have attributes.
  • boolean hasComponentSlot()
    Indicates whether or not a component slot exists.
  • boolean hasParameter(, )
    Indicates whether or not a parameter exist for the current view.
  • importAttributes(, , , , )
    Imports parameter values and error messages from the request directly as view attributes.
  • boolean initialize(, , , )
    Initializes this view.
  • boolean 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(, , )
    Sets an attribute of the view.
  • setComponentSlot(, , )
    Sets the module and action to be executed in place of a particular template attribute.
  • setDecorator()
    Sets the decorating mode for the current view.
  • setDecoratorDirectory()
    Sets the decorator template directory for this view.
  • setDecoratorTemplate()
    Sets the decorator template for this view.
  • setDirectory()
    Sets the template directory for this view.
  • setEscaping()
    Sets the escape caracter mode.
  • setEscapingMethod()
    Sets the escaping method for the current view.
  • setExtension()
    Sets an extension for the current view.
  • setParameter(, , )
    Sets a parameter for the view.
  • setTemplate()
    Sets the template for this view.
  • mixed __call(, )
    Overloads a given method

Method Details

  • configure ()

    Configures template.

  • execute ()

    Executes any presentation logic and set template attributes.

  • (mixed) getAttribute (, , )

    Retrieves an attribute for the current view.

    returns Attribute

  • (sfParameterHolder) getAttributeHolder ()

    Retrieves attributes for the current view.

    returns The attribute parameter holder

  • (array) getComponentSlot ()

    Gets a component slot

    returns The component slot

  • (sfContext) getContext ()

    Retrieves the current application context.

    returns The current sfContext instance

  • (string) getDecoratorDirectory ()

    Retrieves this views decorator template directory.

    returns An absolute filesystem path to this views decorator template directory

  • (string) getDecoratorTemplate ()

    Retrieves this views decorator template.

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

  • (string) getDirectory ()

    Retrieves this view template directory.

    returns An absolute filesystem path to this views template directory

  • (mixed) getEngine ()

    Retrieves the template engine associated with this view.


    Note: This will return null for PHPView instances.

    returns A template engine instance

  • (string) getEscaping ()

    Gets the default escaping strategy associated with this view.


    The escaping strategy specifies how the variables get passed to the view.

    returns the escaping strategy

  • (string) getEscapingMethod ()

    Returns the name of the function that is to be used as the escaping method.


    If the escaping method is empty, then that is returned. The default value
    specified by the sub-class will be used. If the method does not exist (in
    the sense there is no define associated with the method) and exception is
    thrown.

    returns The escaping method as the name of the function to use

    throws sfException If the method does not exist

  • (string) getExtension ()

    Retrieves the current view extension.

    returns The extension for current view.

  • (mixed) getParameter (, , )

    Retrieves a parameter from the current view.

    returns A parameter value

  • (sfParameterHolder) getParameterHolder ()

    Retrieves the parameters for the current view.

    returns The parameter holder

  • (string) getTemplate ()

    Retrieves this views template.

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

  • (mixed) hasAttribute (, )

    Returns true if the view have attributes.

    returns Attribute of the view

  • (boolean) hasComponentSlot ()

    Indicates whether or not a component slot exists.

    returns true, if the component slot exists, otherwise false

  • (boolean) hasParameter (, )

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

    returns true, if the parameter exists otherwise false

  • importAttributes (, , , , )

    Imports parameter values and error messages from the request directly as view attributes.

  • (boolean) initialize (, , , )

    Initializes this view.

    returns true, if initialization completes successfully, otherwise false

  • (boolean) isDecorator ()

    Indicates that this view is a decorating view.

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

  • preRenderCheck ()

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

    Renders the presentation.


    When the controller render mode is sfView::RENDER_CLIENT, this method will
    render the presentation directly to the client and null will be returned.

    returns A string representing the rendered presentation, if the controller render mode is sfView::RENDER_VAR, otherwise null

  • setAttribute (, , )

    Sets an attribute of the view.

  • setComponentSlot (, , )

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

  • setDecorator ()

    Sets the decorating mode for the current view.

  • setDecoratorDirectory ()

    Sets the decorator template directory for this view.

  • setDecoratorTemplate ()

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

    Sets the template directory for this view.

  • setEscaping ()

    Sets the escape caracter mode.

  • setEscapingMethod ()

    Sets the escaping method for the current view.

  • setExtension ()

    Sets an extension for the current view.

  • setParameter (, , )

    Sets a parameter for the view.

  • setTemplate ()

    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 (, )

    Overloads a given method

    returns User function callback

    throws sfException If the call fails