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

rows() public method

public rows ( $rows )
    public function rows($rows)
    {
        $this->setAttribute('rows', $rows);
        return $this;
    }

Usage Example

コード例 #1
0
 public function testRenderWithCustomRows()
 {
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="5" cols="50"></textarea>';
     $result = $textarea->rows(5)->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="3" cols="50"></textarea>';
     $result = $textarea->rows(3)->render();
     $this->assertEquals($expected, $result);
 }