Beispiel #1
0
 public function init()
 {
     $element = new Select();
     $element->setAttributes(['name' => 'category_id']);
     $element->getLabel()->setText('Категория');
     $categories = $this->getServiceManager()->getEntityManager()->get('EvaCatalog\\Entity\\Category')->findAll();
     $element->setOptions($categories);
     $this->append($element);
     parent::init();
 }
Beispiel #2
0
 public function init()
 {
     $element = new Select();
     $element->setAttributes(['name' => 'parent']);
     $element->getLabel()->setText('Родительская категория');
     $categories = $this->getCategoryRepository()->findAll();
     $element->setOptions($categories);
     $element->setEmptyOption('');
     $this->set('parent', $element);
     parent::init();
     $this->remove('url');
 }