AdamWathan\Form\Elements\TextArea::value PHP Method

value() public method

public value ( $value )
    public function value($value)
    {
        $this->value = $value;
        return $this;
    }

Usage Example

Example #1
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);
 }
All Usage Examples Of AdamWathan\Form\Elements\TextArea::value