PHP Class Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper

Author: Fabien Potencier ([email protected])
Author: Bernhard Schussek ([email protected])
Inheritance: extends Symfony\Component\Templating\Helper\Helper
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Свойство Type Description
$context
$engine
$resources
$templates
$themes
$varStack

Méthodes publiques

Méthode Description
__construct ( Symfony\Component\Templating\EngineInterface $engine, array $resources ) Constructor;
enctype ( Symfony\Component\Form\FormView $view ) : string Renders the HTML enctype in the form tag, if necessary.
errors ( Symfony\Component\Form\FormView $view ) : string Renders the errors of the given view.
getName ( )
isChoiceGroup ( $label )
isChoiceSelected ( Symfony\Component\Form\FormView $view, $choice )
label ( Symfony\Component\Form\FormView $view, string $label = null, array $variables = [] ) : string Renders the label of the given view.
renderBlock ( string $name, array $variables = [] ) Render a block from a form element.
rest ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string Renders views which have not already been rendered.
row ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string Renders the entire form field "row".
setTheme ( Symfony\Component\Form\FormView $view, $themes ) Sets a theme for a given view.
widget ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string Renders the HTML for a given view.

Méthodes protégées

Méthode Description
lookupTemplate ( Symfony\Component\Form\FormView $view, string $block ) : string | boolean Returns the name of the template to use to render the block
renderSection ( Symfony\Component\Form\FormView $view, string $section, array $variables = [] ) : string Renders a template.

Method Details

__construct() public méthode

Constructor;
public __construct ( Symfony\Component\Templating\EngineInterface $engine, array $resources )
$engine Symfony\Component\Templating\EngineInterface The templating engine
$resources array An array of theme name

enctype() public méthode

Example usage templates:
enctype() ?>>
public enctype ( Symfony\Component\Form\FormView $view ) : string
$view Symfony\Component\Form\FormView The view for which to render the encoding type
Résultat string The html markup

errors() public méthode

Renders the errors of the given view.
public errors ( Symfony\Component\Form\FormView $view ) : string
$view Symfony\Component\Form\FormView The view to render the errors for
Résultat string The html markup

getName() public méthode

public getName ( )

isChoiceGroup() public méthode

public isChoiceGroup ( $label )

isChoiceSelected() public méthode

public isChoiceSelected ( Symfony\Component\Form\FormView $view, $choice )
$view Symfony\Component\Form\FormView

label() public méthode

Renders the label of the given view.
public label ( Symfony\Component\Form\FormView $view, string $label = null, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The view for which to render the label
$label string The label
$variables array Additional variables passed to the template
Résultat string The html markup

lookupTemplate() protected méthode

Returns the name of the template to use to render the block
protected lookupTemplate ( Symfony\Component\Form\FormView $view, string $block ) : string | boolean
$view Symfony\Component\Form\FormView The form view
$block string The name of the block
Résultat string | boolean The template logical name or false when no template is found

renderBlock() public méthode

Render a block from a form element.
public renderBlock ( string $name, array $variables = [] )
$name string
$variables array Additional variables (those would override the current context)

renderSection() protected méthode

1. This function first looks for a block named "__
", 2. if such a block is not found the function will look for a block named "_
", 3. the type name is recursively replaced by the parent type name until a corresponding block is found
protected renderSection ( Symfony\Component\Form\FormView $view, string $section, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The form view
$section string The section to render (i.e. 'row', 'widget', 'label', ...)
$variables array Additional variables
Résultat string The html markup

rest() public méthode

Renders views which have not already been rendered.
public rest ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The parent view
$variables array An array of variables
Résultat string The html markup

row() public méthode

Renders the entire form field "row".
public row ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The view for which to render the row
$variables array Additional variables passed to the template
Résultat string The html markup

setTheme() public méthode

The theme format is ":".
public setTheme ( Symfony\Component\Form\FormView $view, $themes )
$view Symfony\Component\Form\FormView A FormView instance

widget() public méthode

Example usage: widget() ?> You can pass options during the call: widget(array('attr' => array('class' => 'foo'))) ?> widget(array('separator' => '+++++)) ?>
public widget ( Symfony\Component\Form\FormView $view, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The view for which to render the widget
$variables array Additional variables passed to the template
Résultat string The html markup

Property Details

$context protected_oe property

protected $context

$engine protected_oe property

protected $engine

$resources protected_oe property

protected $resources

$templates protected_oe property

protected $templates

$themes protected_oe property

protected $themes

$varStack protected_oe property

protected $varStack