Inheritance: extends Input
Esempio n. 1
0
 public function text($name)
 {
     $text = new Text($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $text->value($value);
     }
     return $text;
 }
Esempio 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;
 }
Esempio 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);
 }