PHP Class Symfony\Bundle\TwigBundle\Extension\FormExtension

Author: Fabien Potencier ([email protected])
Inheritance: extends Twig_Extension
Datei anzeigen Open project: pmjones/php-framework-benchmarks

Protected Properties

Property Type Description
$cache
$environment
$resources
$templates
$themes

Public Methods

Method Description
__construct ( array $resources = [] )
getFilters ( )
getName ( ) : string Returns the name of the extension.
getTokenParsers ( ) : array Returns the token parser instance to add to the existing list.
initRuntime ( Twig_Environment $environment )
render ( Symfony\Component\Form\FieldInterface $field, array $attributes = [], array $parameters = [], string $resources = null ) Renders the HTML for an individual form field
renderEnctype ( Form $form ) Renders the HTML enctype in the form tag, if necessary
renderErrors ( Symfony\Component\Form\FieldInterface $field, array $parameters = [] ) Renders the errors of the given field
renderHidden ( Symfony\Component\Form\FieldGroupInterface $group, array $parameters = [] ) Renders all hidden fields of the given field group
renderLabel ( Symfony\Component\Form\FieldInterface $field, $label = null, array $parameters = [] ) Renders the label of the given field
setTheme ( Symfony\Component\Form\FieldGroupInterface $group, array $resources )

Protected Methods

Method Description
getWidget ( Symfony\Component\Form\FieldInterface $field, array $resources = [] )
resolveResources ( array $resources )
resolveTemplate ( $template )

Method Details

__construct() public method

public __construct ( array $resources = [] )
$resources array

getFilters() public method

public getFilters ( )

getName() public method

Returns the name of the extension.
public getName ( ) : string
return string The extension name

getTokenParsers() public method

Returns the token parser instance to add to the existing list.
public getTokenParsers ( ) : array
return array An array of Twig_TokenParser instances

getWidget() protected method

protected getWidget ( Symfony\Component\Form\FieldInterface $field, array $resources = [] )
$field Symfony\Component\Form\FieldInterface
$resources array

initRuntime() public method

public initRuntime ( Twig_Environment $environment )
$environment Twig_Environment

render() public method

Example usage in Twig: {{ field|render }} You can pass additional variables during the call: {{ field|render(['param': 'value']) }}
public render ( Symfony\Component\Form\FieldInterface $field, array $attributes = [], array $parameters = [], string $resources = null )
$field Symfony\Component\Form\FieldInterface The field to render
$attributes array
$parameters array
$resources string

renderEnctype() public method

Example usage in Twig templates:
public renderEnctype ( Form $form )
$form Symfony\Component\Form\Form The form for which to render the encoding type

renderErrors() public method

Renders the errors of the given field
public renderErrors ( Symfony\Component\Form\FieldInterface $field, array $parameters = [] )
$field Symfony\Component\Form\FieldInterface The field to render the errors for
$parameters array

renderHidden() public method

Renders all hidden fields of the given field group
public renderHidden ( Symfony\Component\Form\FieldGroupInterface $group, array $parameters = [] )
$group Symfony\Component\Form\FieldGroupInterface The field group
$parameters array

renderLabel() public method

Renders the label of the given field
public renderLabel ( Symfony\Component\Form\FieldInterface $field, $label = null, array $parameters = [] )
$field Symfony\Component\Form\FieldInterface The field to render the label for
$parameters array

resolveResources() protected method

protected resolveResources ( array $resources )
$resources array

resolveTemplate() protected method

protected resolveTemplate ( $template )

setTheme() public method

public setTheme ( Symfony\Component\Form\FieldGroupInterface $group, array $resources )
$group Symfony\Component\Form\FieldGroupInterface
$resources array

Property Details

$cache protected_oe static_oe property

protected static $cache

$environment protected_oe property

protected $environment

$resources protected_oe property

protected $resources

$templates protected_oe property

protected $templates

$themes protected_oe property

protected $themes