Returns rendered HTML form. Tables are used to place form elements.
package | Formagic\Renderer |
---|---|
author | Florian Sonnenburg |
since | 0.2.0 First time introduced |
__construct(\Formagic_Translator_Interface $translator = null
)
\Formagic_Translator_Interface
Translator instance
getContainerLabelTemplate(string|\Formagic_Item_Container $container = ''
) : string
string
\Formagic_Item_Container
Optional. Returns a template defined for one specific container.
string
Template stringgetContainerRowTemplate(string|\Formagic_Item_Container $container = ''
) : string
string
\Formagic_Item_Container
Optional. Returns a template defined for one specific container.
string
Template stringgetContainerWrapperTemplate(string $container = ''
) : string
string
Optional. Returns a template defined for
one specific item with name $name.
string
Template stringgetFormWrapperTemplate() : string
string
Template stringgetItemErrorTemplate(string|\Formagic_Item_Abstract $item = ''
) : string
string
\Formagic_Item_Abstract
Optional. Returns a template defined for one specific item.
string
Template stringgetItemErrorWrapperTemplate(string|\Formagic_Item_Abstract $item = ''
) : string
string
\Formagic_Item_Abstract
Optional. Returns a template defined for one specific item.
string
Template stringgetItemLabelTemplate(string|\Formagic_Item_Abstract $item = ''
) : string
string
\Formagic_Item_Abstract
Optional. Returns a template defined for one specific item.
string
Template stringgetItemRowTemplate(string|\Formagic_Item_Abstract $item = ''
) : string
string
\Formagic_Item_Abstract
Optional. Returns a template defined for one specific item.
string
Template stringgetMandatoryMarkerTemplate(string|\Formagic_Item_Abstract $item = ''
) : string
string
\Formagic_Item_Abstract
Optional. Returns a template defined for one specific item.
string
Template stringgetTranslator() : \Formagic_Translator_Interface
\Formagic_Translator_Interface
Translator objectrender(\Formagic $form) : string
inherited_from | \Formagic_Renderer_Interface::render() |
---|
\Formagic
Formagic object to be rendered.
string
The rendered HTML stringsetContainerLabelTemplate(string $template, string|\Formagic_Item_Container $container = ''
) : \Formagic_Renderer_Html
setContainerRowTemplate(string $template, string|\Formagic_Item_Container $container = ''
) : \Formagic_Renderer_Html
setContainerWrapperTemplate(string $template, string|\Formagic_Item_Container $container = ''
) : \Formagic_Renderer_Html
Available placeholders:
see | |
---|---|
see |
string
Template string
string
\Formagic_Item_Container
Optional. Defines this template only for a specific container.
\Formagic_Renderer_Html
Fluent interfacesetErrorClass(string $errorClass) : \Formagic_Renderer_Html
This css class is per default added to the label and error list tag of items that did not pass validation.
string
New error class
\Formagic_Renderer_Html
Fluent interfacesetFormWrapperTemplate(string $template) : \Formagic_Renderer_Html
Available placeholders:
string
Template string
\Formagic_Renderer_Html
Fluent interfacesetItemErrorTemplate(string $template, string|\Formagic_Item_Abstract $item = ''
) : \Formagic_Renderer_Html
Available placeholders:
string
Template string
string
\Formagic_Item_Abstract
Optional. Defines this
template only for a specific item (name or item object).
\Formagic_Renderer_Html
Fluent interfacesetItemErrorWrapperTemplate(string $template, string|\Formagic_Item_Abstract $item = ''
) : \Formagic_Renderer_Html
Supported placeholders:
string
Template string
string
\Formagic_Item_Abstract
Optional. Defines this
template only for a specific item (name or item object).
\Formagic_Renderer_Html
Fluent interfacesetItemLabelTemplate(string $template, string|\Formagic_Item_Abstract $item = ''
) : \Formagic_Renderer_Html
Available placeholders:
see |
---|
string
Template string
string
\Formagic_Item_Abstract
Optional. Defines this
template only for a specific item (name or item object).
\Formagic_Renderer_Html
Fluent interfacesetItemRowTemplate(string $template, string|\Formagic_Item_Abstract $item = ''
) : \Formagic_Renderer_Html
Available placeholders:
see | |
---|---|
see |
string
Template string
string
\Formagic_Item_Abstract
Optional. Defines this
template only for a specific item (name or item object).
\Formagic_Renderer_Html
Fluent interfacesetMandatoryMarkerTemplate(string $template, string|\Formagic_Item_Abstract $item = ''
) : \Formagic_Renderer_Html
string
Template string
string
\Formagic_Item_Abstract
Optional. Item this template is to be defined for.
\Formagic_Renderer_Html
Fluent interface_addHiddenItem(\Formagic_Item_Hidden $item)
\Formagic_Item_Hidden
Hidden item to be rendered.
_getContainerLabel(\Formagic_Item_Container $container) : string
Returns empty string if no container label is defined.
\Formagic_Item_Container
Container item
string
Container label and template string_getErrorProperties(\Formagic_Item_Abstract $item) : array
Returns empty array if item validated ok.
\Formagic_Item_Abstract
array
Error list and class attribute. Example:
array(
'
- Please enter a value.
',
' class="formagicError"')
_getItemLabel(\Formagic_Item_Abstract $item) : string
Returns a non-breakin-space HTML entity if no item label is provided.
\Formagic_Item_Abstract
Input item
string
Item label and template_renderContainer(\Formagic_Item_Container $container) : string
\Formagic_Item_Container
Container to be rendererd
string
HTML string_setTemplate(array $templateArray, string $template, string|\Formagic_Item_Abstract $item)
array
Template pool new template is to be added to
string
New template string
string
\Formagic_Item_Abstract
_getTemplate(array $templateArray, string|\Formagic_Item_Abstract $item) : string
array
Pool of templates to choose from.
string
\Formagic_Item_Abstract
string
Template string$_containerLabelTemplate : array
array('' => '')
$_containerRowTemplate : array
array('' => '
%CONTAINER%
')
$_containerWrapperTemplate : array
array('' => '
%ROWS%
')
$_errorClass : string
'formagicError'
$_formWrapperTemplate : array
'
'
$_hiddenString : string
''
$_itemErrorTemplate : array
array('' => '%ERRORMESSAGE% ')
$_itemErrorWrapperTemplate : array
array('' => '%ERRORS%
')
$_itemLabelTemplate : array
array('' => '')
$_itemRowTemplate : array
array('' => '
%LABEL%
%ERROR%
%INPUT%
')
$_mandatoryMarkerTemplate : array
array('' => ' *')
$_translator : \Formagic_Translator_Interface