# \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

File
  Core/Template/Smarty/Plugins/Form.php
Package
  \Thelia\Core\Template\Smarty\Plugins
Class hierarchy
  \Thelia\Core\Template\Smarty\AbstractSmartyPlugin
  \Thelia\Core\Template\Smarty\Plugins\Form

## Tags

None found

## Properties

### $request

    $request

#

## Tags

None found

### $parserContext

    $parserContext

#

## Tags

None found

### $formDefinition

    $formDefinition

#

## Tags

None found

## Methods

### __construct()

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

#### Parameters

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

#

## Tags

None found

### setFormDefinition()

    setFormDefinition( $formDefinition)

#### Parameters

| $formDefinition |

#

## Tags

None found

### generateForm()

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

#### Parameters

| $params |
| $content |
\Smarty_Internal_Template | $template |
| $repeat |

#

## Tags

None found

### renderFormField()

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

#### Parameters

| $params |
| $content |
\Smarty_Internal_Template | $template |
| $repeat |

#

## Tags

None found

### renderHiddenFormField()

    renderHiddenFormField( $params, \Smarty_Internal_Template $template)

#### Parameters

| $params |
\Smarty_Internal_Template | $template |

#

## Tags

None found

### formEnctype()

    formEnctype( $params, \Smarty_Internal_Template $template)

#### Parameters

| $params |
\Smarty_Internal_Template | $template |

#

## Tags

None found

### formError()

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

#### Parameters

| $params |
| $content |
\Smarty_Internal_Template | $template |
| $repeat |

#

## Tags

None found

### getPluginDescriptors()

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

#### Returns

\Thelia\Core\Template\Smarty\an —

array of SmartyPluginDescriptor

#

abstract

Inherited from
  \Thelia\Core\Template\Smarty\AbstractSmartyPlugin

## Tags

None found

### 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.

#

Inherited from
  \Thelia\Core\Template\Smarty\AbstractSmartyPlugin

## Tags

None 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.

#

Inherited from
  \Thelia\Core\Template\Smarty\AbstractSmartyPlugin

## Tags

None found

### assignFieldErrorVars()

    assignFieldErrorVars(\Smarty_Internal_Template $template, array $errors)

#### Parameters

\Smarty_Internal_Template | $template |
array | $errors |

#

## Tags

None found

### isHidden()

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

#### Parameters

\Symfony\Component\Form\FormView | $formView |

#

## Tags

None found

### getFormFieldView()

    getFormFieldView( $params)

#### Parameters

| $params |

#

## Tags

None found

### getInstanceFromParams()

    getInstanceFromParams( $params)

#### Parameters

| $params |

#

## Tags

None found

### createInstance()

    createInstance( $name)

#### Parameters

| $name |

#

## Tags

None found

### _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:

#

Inherited from
  \Thelia\Core\Template\Smarty\AbstractSmartyPlugin

## Tags

None found

### Form.php