Inheritance: extends Input
Exemplo n.º 1
0
 public function text($name)
 {
     $text = new Text($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $text->value($value);
     }
     return $text;
 }
Exemplo n.º 2
0
 public function render()
 {
     $html = '<div class="input-group">';
     $html .= $this->renderAddons($this->beforeAddon);
     $html .= parent::render();
     $html .= $this->renderAddons($this->afterAddon);
     $html .= '</div>';
     return $html;
 }
Exemplo n.º 3
0
 public function testDataAttribute()
 {
     $text = new Text('email');
     $expected = '<input type="text" name="email" data-sample="test-value">';
     $result = $text->data('sample', 'test-value')->render();
     $this->assertEquals($expected, $result);
     $text = new Text('email');
     $expected = '<input type="text" name="email" data-custom="another-value">';
     $result = $text->data('custom', 'another-value')->render();
     $this->assertEquals($expected, $result);
 }