Inheritance: extends FormControl
Ejemplo n.º 1
0
 public function textarea($name)
 {
     $textarea = new TextArea($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $textarea->value($value);
     }
     return $textarea;
 }
Ejemplo n.º 2
0
 public function testDefaultValue()
 {
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">My information</textarea>';
     $result = $textarea->defaultValue('My information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Your information</textarea>';
     $result = $textarea->defaultValue('Your information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->value('Testing')->defaultValue('My information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->value('Testing')->defaultValue('Your information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->defaultValue('My information')->value('Testing')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->defaultValue('Your information')->value('Testing')->render();
     $this->assertEquals($expected, $result);
 }