public function buildTemplate() { $options = []; $options['clearSelect'] = true; $options['select'][] = \Rebond\Cms\Template\Data::getList(['id', 'title']); $models = \Rebond\Cms\Template\Data::loadAll($options); return Util\Form::buildDropdownList('templateId' . $this->unique, $models, 'id', 'title', $this->getModel()->getTemplateId(), $this->templateValidator['foreignKey']); }
public function template() { // auth Auth::isAdminAuthorized($this->signedUser, 'admin.cms.template', true, '/cms'); $templates = \Rebond\Cms\Template\Data::loadAll(); // view $this->setTpl(); // filter $tplFilter = new Template(Template::MODULE, ['cms', 'template']); $tplFilter->set('count', count($templates)); // main $tplMain = new Template(Template::MODULE, ['cms', 'template']); $tplMain->set('items', $templates); // layout $this->tplLayout->set('column1', $tplFilter->render('filter')); $this->tplLayout->set('column2', $tplMain->render('listing')); // master $this->tplMaster->set('layout', $this->tplLayout->render('layout-2-row')); return $this->tplMaster->render('tpl-default'); }