category |
Formagic |
package |
Renderer |
author |
Florian Sonnenburg |
copyright |
Copyright (c) 2007-2011 Florian Sonnenburg |
version |
$Id: Xhtml.php 160 2012-04-02 20:18:14Z meweasle $ |
Methods
Constructor
__construct(Formagic_Translator $translator)
Returns container label template.
getContainerLabelTemplate(string | \Formagic_Item_Container $container) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getContainerLabelTemplate() |
Parameters
Returns
string
Template string
Returns the template for rows that hold sub-containers.
getContainerRowTemplate(string | \Formagic_Item_Container $container) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getContainerRowTemplate() |
Parameters
Returns
string
Template string
Returns wrapper template for containers.
getContainerWrapperTemplate(string $container) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getContainerWrapperTemplate() |
Parameters
$container
string
Optional. Returns a template defined for one specific item with name $name.
Returns
string
Template string
Returns single error message template
getItemErrorTemplate(string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getItemErrorTemplate() |
Parameters
Returns
string
Template string
Returns error wrapper template for item errors.
getItemErrorWrapperTemplate(string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getItemErrorWrapperTemplate() |
Parameters
Returns
string
Template string
Returns label template for an item.
getItemLabelTemplate(string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getItemLabelTemplate() |
Parameters
Returns
string
Template string
Returns item row template.
getItemRowTemplate(string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getItemRowTemplate() |
Parameters
Returns
string
Template string
Returns marker string for items marked as mandatory.
getMandatoryMarkerTemplate(string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::getMandatoryMarkerTemplate() |
Parameters
Returns
string
Template string
Returns current translator instance.
getTranslator() : \Formagic_Translator
Inherited
inherited_from |
\Formagic_Renderer_Html::getTranslator() |
Returns
Returns form HTML string
render(Formagic $form) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::render() |
Parameters
$form
\Formagic
Formagic object to be rendered.
Returns
string
The rendered HTML string
Sets container label template (empty by default).
setContainerLabelTemplate(string $template, string | \Formagic_Item_Container $container) : \Formagic_Renderer_Html
Inherited
Available placeholders:
- %LABEL%: Label string
see |
\setContainerWrapperTemplate() |
see |
\setContainerRowTemplate() |
inherited_from |
\Formagic_Renderer_Html::setContainerLabelTemplate() |
Parameters
$template
string
Template string
$container
string\Formagic_Item_Container
Optional. Defines this template only for a specific container (name or container object).
Returns
Sets new template for rows that hold sub-containers
(tr/td tags by default).
setContainerRowTemplate(string $template, string | \Formagic_Item_Container $container) : \Formagic_Renderer_Html
Inherited
Supported placeholders:
- %CONTAINER%: HTML for the subcontainer, including it's wrapper
see |
\setContainerLabelTemplate() |
see |
\setContainerWrapperTemplate() |
inherited_from |
\Formagic_Renderer_Html::setContainerRowTemplate() |
Parameters
$template
string
Template string
Returns
Sets wrapper template for containers
(opening/closing table tag by default).
setContainerWrapperTemplate(string $template, string | \Formagic_Item_Container $container) : \Formagic_Renderer_Html
Inherited
Available placeholders:
- %ROWS%: Rendered rows as HTML, including row wrapper
- %ATTRIBUTES%: Assembled attributes string as HTML
- %LABEL%: Rendered container label as HTML
see |
\setContainerLabelTemplate() |
see |
\setContainerRowTemplate() |
inherited_from |
\Formagic_Renderer_Html::setContainerWrapperTemplate() |
Parameters
$template
string
Template string
Returns
Sets error CSS class.
setErrorClass(string $errorClass) : \Formagic_Renderer_Html
Inherited
This css class is per default added to the label and error list
tag of items that did not pass validation.
inherited_from |
\Formagic_Renderer_Html::setErrorClass() |
Parameters
$errorClass
string
New error class
Returns
Sets a new template for a single error message (HTML LI tag by default)
setItemErrorTemplate(string $template, string | \Formagic_Item_Abstract $item) : \Formagic_Renderer_Html
Inherited
Available placeholders:
- %ERRORMESSAGE%: Message string returned by violated rule
inherited_from |
\Formagic_Renderer_Html::setItemErrorTemplate() |
Parameters
$template
string
Template string
Returns
Sets error wrapper template (opening and closing list tags by default).
setItemErrorWrapperTemplate(string $template, string | \Formagic_Item_Abstract $item) : \Formagic_Renderer_Html
Inherited
Supported placeholders:
- %ERRORS%: Rendered list of item errors
inherited_from |
\Formagic_Renderer_Html::setItemErrorWrapperTemplate() |
Parameters
$template
string
Template string
Returns
Sets label template for a single item (label tag by default).
setItemLabelTemplate(string $template, string | \Formagic_Item_Abstract $item) : \Formagic_Renderer_Html
Inherited
Available placeholders:
- %LABEL%: Label string defined for item
- %ID%: Value of Item's HTML ID attribute
- %MANDATORYMARKER%: Marker for items with mandatory rule
see |
\setItemRowTemplate() |
inherited_from |
\Formagic_Renderer_Html::setItemLabelTemplate() |
Parameters
$template
string
Template string
Returns
Sets template for rows containing input items (tr/td tags by default).
setItemRowTemplate(string $template, string | \Formagic_Item_Abstract $item) : \Formagic_Renderer_Html
Inherited
Available placeholders:
- %LABEL%: Item label string
- %ERROR%: Assembled error list (HTML)
- %ERRORCLASS%: CSS class attribute with error class (eg. ' class="formagicError"')
- %INPUT%: Input HTML
see |
\setItemLabelTemplate() |
see |
\setItemErrorTemplate() |
inherited_from |
\Formagic_Renderer_Html::setItemRowTemplate() |
Parameters
$template
string
Template string
Returns
Sets marker string for items that are marked mandatory
(asterisk by default).
setMandatoryMarkerTemplate(string $template, string | \Formagic_Item_Abstract $item) : \Formagic_Renderer_Html
Inherited
inherited_from |
\Formagic_Renderer_Html::setMandatoryMarkerTemplate() |
Parameters
$template
string
Template string
Returns
Adds hidden fields to form HTML string.
_addHiddenItem(Formagic_Item_Hidden $item)
Inherited
inherited_from |
\Formagic_Renderer_Html::_addHiddenItem() |
Parameters
Renders a container label into the container label template.
_getContainerLabel(Formagic_Item_Container $container) : string
Inherited
Returns empty string if no container label is defined.
inherited_from |
\Formagic_Renderer_Html::_getContainerLabel() |
Parameters
Returns
string
Container label and template string
Returns the rendered error list and HTML class attribute.
_getErrorProperties(Formagic_Item_Abstract $item) : array
Inherited
Returns empty array if item validated ok.
inherited_from |
\Formagic_Renderer_Html::_getErrorProperties() |
Parameters
Returns
array
Error list and class attribute. Example:
array( '', ' class="formagicError"')
Returns rendered item label and template.
_getItemLabel(Formagic_Item_Abstract $item) : string
Inherited
Returns a non-breakin-space HTML entity if no item label is provided.
inherited_from |
\Formagic_Renderer_Html::_getItemLabel() |
Parameters
Returns
string
Item label and template
Returns HTML for all items of a container (recursively)
_renderContainer(Formagic_Item_Container $container) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::_renderContainer() |
Parameters
Returns
string
HTML string
Sets a template string for an item to a template pool.
_setTemplate(array $templateArray, string $template, string | \Formagic_Item_Abstract $item)
Inherited
inherited_from |
\Formagic_Renderer_Html::_setTemplate() |
Parameters
$templateArray
array
Template pool new template is to be added to
$template
string
New template string
Returns a template for a specific item from a template array.
_getTemplate(array $templateArray, string | \Formagic_Item_Abstract $item) : string
Inherited
inherited_from |
\Formagic_Renderer_Html::_getTemplate() |
Parameters
$templateArray
array
Pool of templates to choose from.
Returns
string
Template string
Properties
Container label template array
$_containerLabelTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_containerLabelTemplate |
Template for rows containing containers
$_containerRowTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_containerRowTemplate |
Container wrapping template array
$_containerWrapperTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_containerWrapperTemplate |
Error class name
$_errorClass : string
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_errorClass |
Hidden inputs string
$_hiddenString : string
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_hiddenString |
Array of templates for displaying the item error string (list elements)
$_itemErrorTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_itemErrorTemplate |
Array of templates for item's error wrapper (list open tag)
$_itemErrorWrapperTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_itemErrorWrapperTemplate |
Template for displaying the item label array
$_itemLabelTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_itemLabelTemplate |
Template for rows containing normal items array
$_itemRowTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_itemRowTemplate |
HTML string for mandatory fields array
$_mandatoryMarkerTemplate : array
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_mandatoryMarkerTemplate |
Translator object
$_translator : \Formagic_Translator
Inherited
inherited_from |
\Formagic_Renderer_Html::$$_translator |