PHP Класс Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper

Автор: Fabien Potencier ([email protected])
Автор: Bernhard Schussek ([email protected])
Наследование: extends Symfony\Component\Templating\Helper\Helper
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$context
$engine
$resources
$templates
$themes
$varStack

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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() публичный Метод

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
Результат string The html markup

errors() публичный Метод

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
Результат string The html markup

getName() публичный Метод

public getName ( )

isChoiceGroup() публичный Метод

public isChoiceGroup ( $label )

isChoiceSelected() публичный Метод

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

label() публичный Метод

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
Результат string The html markup

lookupTemplate() защищенный Метод

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
Результат string | boolean The template logical name or false when no template is found

renderBlock() публичный Метод

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() защищенный Метод

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
Результат string The html markup

rest() публичный Метод

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
Результат string The html markup

row() публичный Метод

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
Результат string The html markup

setTheme() публичный Метод

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

widget() публичный Метод

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
Результат string The html markup

Описание свойств

$context защищенное свойство

protected $context

$engine защищенное свойство

protected $engine

$resources защищенное свойство

protected $resources

$templates защищенное свойство

protected $templates

$themes защищенное свойство

protected $themes

$varStack защищенное свойство

protected $varStack