Exemple #1
0
 public function testDefaultValue()
 {
     $input = new InputGroup('test');
     $expected = '<div class="input-group"><input type="text" name="test" value="abc"></div>';
     $result = $input->defaultValue('abc')->render();
     $this->assertEquals($expected, $result);
     $input = new InputGroup('test');
     $expected = '<div class="input-group"><input type="text" name="test" value="xyz"></div>';
     $result = $input->value('xyz')->defaultValue('abc')->render();
     $this->assertEquals($expected, $result);
     $input = new InputGroup('test');
     $expected = '<div class="input-group"><input type="text" name="test" value="xyz"></div>';
     $result = $input->defaultValue('abc')->value('xyz')->render();
     $this->assertEquals($expected, $result);
 }
 public function inputGroup($label, $name, $value = null)
 {
     $control = new InputGroup($name);
     if (!is_null($value) || !is_null($value = $this->getValueFor($name))) {
         $control->value($value);
     }
     return $this->formGroup($label, $name, $control);
 }