';
switch ($layout) {
case FormValidator::LAYOUT_INLINE:
$template = '
{element}
';
break;
case FormValidator::LAYOUT_HORIZONTAL:
$template = '
{icon}
{element}
{label_2}
{error}
{label_3}
';
break;
case FormValidator::LAYOUT_BOX_NO_LABEL:
if (isset($attributes['custom']) && $attributes['custom'] == true) {
$template = '
{icon}
{element}
';
}
break;
}
return $template;
}
/**
* Sets size of text field
*
* @param string $size Size of text field
* @since 1.3
* @access public
* @return void
*/
public function setSize($size)
{
$this->updateAttributes(array('size' => $size));
}
/**
* Sets maxlength of text field
*
* @param string $maxlength Maximum length of text field
* @since 1.3
* @access public
* @return void
*/
public function setMaxlength($maxlength)
{
$this->updateAttributes(array('maxlength' => $maxlength));
}
/**
* @return string
*/
public function toHtml()
{
if ($this->isFrozen()) {
return $this->getFrozenHtml();
}
return '_getAttrString($this->_attributes).' />';
}
}