Datatypes\Textarea\Editor::load PHP Method

load() public method

Load textarea editor
public load ( ) : Zend\Form\Element\Textarea
return Zend\Form\Element\Textarea
    public function load()
    {
        $config = $this->getConfig();
        $property = $this->getProperty();
        $textarea = new Element\Textarea($this->getName());
        $textarea->setAttribute('class', 'form-control');
        $textarea->setAttribute('required', $property->isRequired());
        $textarea->setAttribute('id', $this->getName());
        $textarea->setLabel($this->getProperty()->getName());
        $textarea->setValue($this->getValue());
        $config = empty($config) ? array() : $config;
        foreach ($config as $key => $value) {
            if (!empty($value)) {
                $textarea->setAttribute($key, $value);
            }
        }
        return $textarea;
    }

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testLoad()
 {
     $this->assertInstanceOf('Zend\\Form\\Element\\Textarea', $this->object->load());
 }