Ejemplo n.º 1
0
 /**
  * @param mixed $content
  * @param mixed $value
  *
  * @since 2.0
  */
 public function __construct($content = null, $value = null)
 {
     parent::__construct();
     $this->setContents($content);
     if (is_null($value)) {
         $value = $content;
     }
     $this->setValue($value);
     unset($this->attributes['name']);
 }
Ejemplo n.º 2
0
 /**
  * @param InputElement|Select|ToggleGroup $element
  *
  * @since 2.0
  */
 public function renderInput($element)
 {
     if ($element instanceof Option || $element instanceof Optgroup || $element instanceof Checkbox || $element instanceof Radio) {
         return $element->render($this);
     }
     $name = $element->getName();
     $element->setAttribute('id', 'form_' . $name);
     $this->table->addCell($element->getLabel());
     $this->table->addCell($element->render($this));
     $this->table->addRow();
     return '';
 }
Ejemplo n.º 3
0
 /**
  * @param string $name
  * @param array  $attributes
  * @param mixed  $value
  *
  * @since 2.0
  */
 public function __construct($name = '', array $attributes = [], $value = null)
 {
     $attributes['type'] = 'reset';
     parent::__construct($name, $attributes, $value);
 }
Ejemplo n.º 4
0
 /**
  * Extends setValue to make sure content is set for correct repopulation.
  *
  * @param  string $value
  *
  * @return InputElement
  *
  * @since 2.0
  */
 public function setValue($value)
 {
     $this->setContents($value);
     return parent::setValue($value);
 }
Ejemplo n.º 5
0
 /**
  * @covers ::render
  * @group  Fieldset
  */
 public function testRender()
 {
     $render = \Mockery::mock('Fuel\\Fieldset\\Render');
     $render1 = $this->object->render($render);
     $this->assertXmlStringEqualsXmlString('<input name="" value=""/>', $render1);
 }