Redaxscript\Html\Form::textarea PHP Method

textarea() public method

append the textarea
Since: 2.6.0
public textarea ( array $attributeArray = [] ) : Form
$attributeArray array attributes of the textarea
return Form
    public function textarea($attributeArray = [])
    {
        if (is_array($attributeArray)) {
            $attributeArray = array_merge($this->_attributeArray['textarea'], $attributeArray);
        } else {
            $attributeArray = $this->_attributeArray['textarea'];
        }
        $textareaElement = new Element();
        $textareaElement->init('textarea', $attributeArray)->text($attributeArray['value'])->val(null);
        $this->append($textareaElement);
        return $this;
    }

Usage Example

 /**
  * testTextarea
  *
  * @param array $attributeArray
  * @param array $expect
  *
  * @dataProvider providerTextarea
  *
  * @since 2.6.0
  */
 public function testTextarea($attributeArray = array(), $expect = array())
 {
     /* setup */
     $form = new Html\Form($this->_registry, $this->_language);
     $form->init();
     $form->textarea($attributeArray);
     /* actual */
     $actual = $form;
     /* compare */
     $this->assertEquals($expect, $actual);
 }