/** * Render in HTML an element of type Submit * @param \Phalcon\Forms\ElementInterface $element * @return string */ function _renderSubmit($element) { $elementClasses = "btn btn-default " . $element->getAttribute("class", ""); $element->setAttribute("class", $elementClasses); $html = $this->render($element->getName()); return $html; }
/** * Render in HTML an element of type Submit * @param \Phalcon\Forms\ElementInterface $element * @return string */ function _renderButton($element) { $elementClasses = 'btn waves-effect ' . $element->getAttribute('class', ''); $element->setAttribute('class', $elementClasses); $html = $this->render($element->getName()); return $html; }
/** * Add element to form * * @param FElementInterface $element * @param string $position * @param bool $type If $type is TRUE, the element wile add before $position, else is after * @return \ZCMS\Core\Forms\ZForm */ public function add(FElementInterface $element, $position = null, $type = null) { if ($this->bootstrap) { $class = $element->getAttribute("class"); $classes = array_map("trim", explode(" ", $class)); if (!in_array("form-control", $classes)) { $element->setAttribute("class", "form-control " . $class); } } if ($this->_autoGenerateTranslateLabel && $this->_formName != null) { $title = __($this->_formName . '_' . $element->getName()); $attributes = $element->getAttributes(); if (isset($attributes['required'])) { $title .= ' <span class="symbol required"></span>'; } $element->setLabel($title); } return parent::add($element, $position, $type); }