예제 #1
0
파일: Csrf.php 프로젝트: haoyanfei/zf2
 /**
  * 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;
 }
예제 #2
0
 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());
 }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }
예제 #5
0
 /**
  * @return array|\Traversable
  */
 public function getAttributes()
 {
     $this->loadOptions();
     return parent::getAttributes();
 }
예제 #6
0
 /**
  * @inheritdoc
  */
 public function getAttributes()
 {
     return $this->element->getAttributes();
 }