/** * Override: get attributes * * Seeds 'value' attribute with validator hash * * @return array */ public function getAttributes() { $attributes = parent::getAttributes(); $validator = $this->getValidator(); $attributes['value'] = $validator->getHash(); return $attributes; }
public function testCanClearAllAttributes() { $element = new Element(); $attributes = array('type' => 'text', 'class' => 'text-element', 'data-foo' => 'bar'); $element->setAttributes($attributes); $element->clearAttributes(); $this->assertEquals(array(), $element->getAttributes()); }
protected function createElement(Element $element, $attr = array()) { $tmpAttr = $element->getAttributes(); $element->setAttributes($this->_getElementAttr($element, $attr)); $html = $this->_getElementRenderer($element->getAttribute('type'))->render($element); $element->setAttributes($tmpAttr); return $html; }
public function createElement(Element $form, $attr = array()) { $tmpAttr = $form->getAttributes(); $form->setAttributes($this->_getElementAttr($form, $attr)); $html = $this->view->form()->openTag($form); $form->setAttributes($tmpAttr); return $html; }
/** * @return array|\Traversable */ public function getAttributes() { $this->loadOptions(); return parent::getAttributes(); }
/** * @inheritdoc */ public function getAttributes() { return $this->element->getAttributes(); }