function getAttributes() { $attributes = parent::getAttributes(); if ($this->multiple) { $attributes["name"] .= "[]"; } return $attributes; }
/** * Parse the template * * @return string */ public function generate() { $this->Template = new \FrontendTemplate($this->strTemplate); $this->Template->field = $this->objWidget; $this->Template->attributes = $this->objWidget->getAttributes(); $this->Template->tagEnding = $this->strTagEnding; $this->Template->hideLabel = $this->hideLabel || $this->objWidget->hideLabel; $this->Template->explanation = $this->explanation || $this->objWidget->explanation; $this->Template->invisible = $this->invisible || $this->objWidget->invisible; $this->Template->help = $this->parseHelp(); $this->setCssClasses(); $this->setGroupCssClasses(); $this->compile(); $this->Template->class = $this->getCssClasses(); $this->Template->groupClass = $this->getGroupCssClasses(); $this->Template->attributes = $this->objWidget->getAttributes(); $this->Template->placeholder = $this->parsePlaceholder(); return $this->Template->parse(); }
/** * Return all attributes as string * * @param array $arrStrip An optional array with attributes to strip * * @return string The attributes string */ public function getAttributes($arrStrip = array()) { // The "required" attribute only makes sense for single checkboxes if (count($this->arrOptions) == 1 && $this->mandatory) { $this->arrAttributes['required'] = 'required'; } return parent::getAttributes($arrStrip); }
/** * Return all attributes as string * * @param array $arrStrip An optional array with attributes to strip * * @return string The attributes string */ public function getAttributes($arrStrip = array()) { /** @var \PageModel $objPage */ global $objPage; $arrStrip = array(); // XHTML does not support maxlength if ($objPage->outputFormat == 'xhtml') { $arrStrip[] = 'maxlength'; } return parent::getAttributes($arrStrip); }