public function formField($vars) { $helper = new Kwf_View_Helper_FormField(); return new Twig_Markup($helper->formField($vars), 'utf-8'); }
public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '') { $ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix); $helper = new Kwf_View_Helper_FormField(); $ret['html'] = '<div class="kwfFormFieldMultiCheckbox kwfFormFieldMultiCheckbox' . ucfirst($this->getOutputType()) . '"'; $ret['html'] .= ' data-fieldname="' . $this->getFieldName() . $fieldNamePostfix . '"'; $ret['html'] .= '>'; $fields = $this->_getFields()->getTemplateVars($values, $fieldNamePostfix, $idPrefix); $i = 0; foreach ($fields as $field) { $ret['html'] .= '<div class="checkboxItem' . ($i == 0 ? ' first' : '') . '">' . $helper->returnFormField($field) . '</div>'; $i++; } $ret['html'] .= '<div class="checkboxItemEnd"></div>'; if ($this->getShowCheckAllLinks()) { $ret['html'] .= '<div class="checkAllLinksWrapper">' . '<a href="#" class="kwfMultiCheckboxCheckAll">' . $this->getCheckAllText() . '</a>' . ' / ' . '<a href="#" class="kwfMultiCheckboxCheckNone">' . $this->getCheckNoneText() . '</a>' . '</div>'; } $ret['html'] .= '</div>'; return $ret; }