getIcons() public method

Get views
public getIcons ( boolean $forceReload = false ) : array
$forceReload boolean to initiliaze views
return array
Beispiel #1
0
 /**
  * Initialize infos sub form
  *
  * @return \Zend\Form\FieldSet
  */
 protected function getInfos()
 {
     $fieldsets = $this->getFieldSets();
     if (!empty($fieldsets['infos'])) {
         return $fieldsets['infos'];
     }
     $fieldsets = new FieldSet('infos');
     $this->getInputFilter()->add(array('type' => 'Zend\\InputFilter\\InputFilter', 'name' => array('name' => 'name', 'required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'db\\no_record_exists', 'options' => array('table' => 'document_type', 'field' => 'name', 'adapter' => $this->getAdapter())))), 'description' => array('name' => 'description', 'required' => false, 'allow_empty' => true), 'icon_id' => array('name' => 'icon_id', 'required' => true, 'allow_empty' => false), 'dependency' => array('name' => 'dependency', 'required' => false, 'allow_empty' => true)), 'infos');
     $fieldsets->add(new Element\Text('name'));
     $fieldsets->add(new Element\Text('description'));
     $iconId = new Element\Select('icon_id');
     $collection = new Icon\Collection();
     $iconId->setValueOptions($collection->getIcons())->setAttribute('class', 'form-control');
     $fieldsets->add($iconId);
     $documentTypeCollection = new DocumentTypeCollection();
     $select = $documentTypeCollection->getSelect();
     if (!empty($select)) {
         $dependency = new Element\MultiCheckbox('infos[dependency]');
         $dependency->setAttribute('class', 'input-checkbox');
         $dependency->setValueOptions($documentTypeCollection->getSelect());
         $fieldsets->add($dependency);
     }
     $this->add($fieldsets);
     return $fieldsets;
 }