Datatypes\Textarea\PrevalueEditor::load PHP Method

load() public method

Load Textarea prevalue editor - cols: Number of caracters display per line - rows: Define the number of line visible in text zone - wrap: Possible values are : hard / off / soft define if line returns are automatic (hard / soft) or if the horizontal display if exceeded (off)
public load ( ) : mixed
return mixed
    public function load()
    {
        $config = $this->getConfig();
        $cols = new Element\Text('cols');
        $cols->setAttributes(array('value' => isset($config['cols']) ? $config['cols'] : '', 'class' => 'form-control'));
        $cols->setOptions(array('label' => 'Cols', 'label_attributes' => array('class' => 'required control-label col-lg-2')));
        $rows = new Element\Text('rows');
        $rows->setAttributes(array('value' => isset($config['rows']) ? $config['rows'] : '', 'class' => 'form-control'));
        $rows->setOptions(array('label' => 'Rows', 'label_attributes' => array('class' => 'required control-label col-lg-2')));
        $wrap = new Element\Select('wrap');
        $wrap->setAttributes(array('class' => 'form-control', 'options' => array('hard' => 'hard', 'off' => 'off', 'soft' => 'soft'), 'value' => isset($config['wrap']) ? $config['wrap'] : ''));
        $wrap->setOptions(array('label' => 'Wrap', 'label_attributes' => array('class' => 'required control-label col-lg-2')));
        return array($cols, $rows, $wrap);
    }

Usage Example

Beispiel #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testLoad()
 {
     $this->assertInternalType('array', $this->object->load());
 }
PrevalueEditor