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

cols() public method

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

Usage Example

Example #1
0
 public function testRenderWithCustomCols()
 {
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="30"></textarea>';
     $result = $textarea->cols(30)->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="15"></textarea>';
     $result = $textarea->cols(15)->render();
     $this->assertEquals($expected, $result);
 }