Beispiel #1
0
 protected function createComponentMenuForm()
 {
     $menus = $this->menu->where('menu_id', null)->fetchPairs('id', 'name');
     $menus[null] = '-- Není --';
     $articles = $this->article->fetchPairs('id', 'name');
     $articles[null] = '-- Není --';
     $form = new UI\Form();
     $form->addSelect('menu_id', 'Nadřazené menu', $menus);
     $form->addText('name', 'Název:')->setRequired();
     $form->addText('url', 'Url:');
     $form->addSelect('article_id', 'Článek:', $articles);
     $form->addSubmit('save', 'Uložit')->setAttribute('class', 'btn btn-primary');
     $form->onSuccess[] = array($this, 'menuFormSucceeded');
     return $form;
 }
 public function testAction()
 {
     $data['title'] = 'Tin Nổi Bật | Blog Tin Tức';
     $data['menu'] = Menu::where('status', 1)->get();
     return $this->render('default/category/index.html.twig', $data);
 }
Beispiel #3
0
 public function beforeRender()
 {
     $this->template->menus = $this->menu->where('menu_id', null);
 }
 public function userinfoAction()
 {
     $data['title'] = 'Đăng Kí| Blog Tin Tức';
     $data['menu'] = Menu::where('status', 1)->get();
     return $this->render('default/user/detail.html.twig', $data);
 }