\Thelia\Core\Template\Smarty\PluginsForm

Plugin for smarty defining blocks and functions for using Form display.

blocks : - {form name="myForm"} ... {/form} => find form named myForm, create an instance and assign this instanciation into smarty variable. Form must be declare into config using tag

  • {form_field form=$form.fieldName} {/form_field} This block find info into the Form field containing by the form paramter. This field must be an instance of FormView. fieldName is the name of your field. This block can output these info :

    • $name => name of yout input
    • $value => value for your input
    • $label => label for your input
    • $error => boolean for know if there is error for this field
    • $attr => all your attribute for your input (define when you construct programmatically you form)
  • {form_error form=$form.fieldName} ... {/form_error} Display this block if there are errors on this field. fieldName is the name of your field

Class Form

Summary

Methods
Properties
Constants
__construct()
setFormDefinition()
generateForm()
renderFormField()
renderHiddenFormField()
formEnctype()
formError()
getPluginDescriptors()
getNormalizedParam()
getParam()
No public properties found
No constants found
assignFieldErrorVars()
isHidden()
getFormFieldView()
getInstanceFromParams()
createInstance()
_explode()
$request
$parserContext
$formDefinition
N/A
No private methods found
No private properties found
N/A

Properties

$request

$request

$parserContext

$parserContext

$formDefinition

$formDefinition

Methods

__construct()

__construct(\Symfony\Component\HttpFoundation\Request $request, \Thelia\Core\Template\ParserContext $parserContext)

Parameters

\Symfony\Component\HttpFoundation\Request $request
\Thelia\Core\Template\ParserContext $parserContext

setFormDefinition()

setFormDefinition( $formDefinition)

Parameters

$formDefinition

generateForm()

generateForm( $params,  $content, \Smarty_Internal_Template $template,  $repeat)

Parameters

$params
$content
\Smarty_Internal_Template $template
$repeat

renderFormField()

renderFormField( $params,  $content, \Smarty_Internal_Template $template,  $repeat)

Parameters

$params
$content
\Smarty_Internal_Template $template
$repeat

renderHiddenFormField()

renderHiddenFormField( $params, \Smarty_Internal_Template $template)

Parameters

$params
\Smarty_Internal_Template $template

formEnctype()

formEnctype( $params, \Smarty_Internal_Template $template)

Parameters

$params
\Smarty_Internal_Template $template

formError()

formError( $params,  $content, \Smarty_Internal_Template $template,  $repeat)

Parameters

$params
$content
\Smarty_Internal_Template $template
$repeat

getPluginDescriptors()

getPluginDescriptors() : \Thelia\Core\Template\Smarty\an

Returns

\Thelia\Core\Template\Smarty\an —

array of SmartyPluginDescriptor

getNormalizedParam()

getNormalizedParam(array $params, mixed $name, mixed $default) : mixed

Get a function or block parameter value, and normalize it, trimming balnks and making it lowercase

Parameters

array $params

the parameters array

mixed $name

as single parameter name, or an array of names. In this case, the first defined parameter is returned. Use this for aliases (context, ctx, c)

mixed $default

the defaut value if parameter is missing (default to null)

Returns

mixed —

the parameter value, or the default value if it is not found.

getParam()

getParam(array $params, mixed $name, mixed $default) : mixed

Get a function or block parameter value

Parameters

array $params

the parameters array

mixed $name

as single parameter name, or an array of names. In this case, the first defined parameter is returned. Use this for aliases (context, ctx, c)

mixed $default

the defaut value if parameter is missing (default to null)

Returns

mixed —

the parameter value, or the default value if it is not found.

assignFieldErrorVars()

assignFieldErrorVars(\Smarty_Internal_Template $template, array $errors)

Parameters

\Smarty_Internal_Template $template
array $errors

isHidden()

isHidden(\Symfony\Component\Form\FormView $formView)

Parameters

\Symfony\Component\Form\FormView $formView

getFormFieldView()

getFormFieldView( $params)

Parameters

$params

getInstanceFromParams()

getInstanceFromParams( $params)

Parameters

$params

createInstance()

createInstance( $name)

Parameters

$name

_explode()

_explode(\Thelia\Core\Template\Smarty\unknown $commaSeparatedValues) : \Thelia\Core\Template\Smarty\multitype:

Explode a comma separated list in a array, trimming all array elements

Parameters

\Thelia\Core\Template\Smarty\unknown $commaSeparatedValues

Returns

\Thelia\Core\Template\Smarty\multitype: