Datatypes\CheckboxList\Editor::load PHP Method

load() public method

Load checkbox list editor
public load ( ) : Zend\Form\Element\MultiCheckbox
return Zend\Form\Element\MultiCheckbox
    public function load()
    {
        $parameters = $this->getConfig();
        $element = new Element\MultiCheckbox($this->getName());
        if (!empty($parameters)) {
            $element->setValueOptions($parameters);
        }
        $element->setLabel($this->getProperty()->getName())->setAttribute('id', $this->getName())->setAttribute('required', $this->getProperty()->isRequired())->setAttribute('class', 'input-checkbox')->setValue($this->getValue());
        return $element;
    }

Usage Example

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