protected function buildForm()
 {
     $this->tagsPairs = $this->tags->findMainTags()->fetchPairs('slug', 'name');
     $this->addText('search', 'Search', NULL, 100);
     $this->addSelect('category', 'Category', $this->tagsPairs)->setPrompt('Choose category');
     $this->addSubmit('sub', 'Filter');
 }
Esempio n. 2
0
 /**
  * @return array
  */
 private function getCategories()
 {
     $categories = array();
     foreach ($this->tags->findMainTags() as $tag) {
         $categories[$tag->id] = $tag->name;
     }
     return $categories;
 }
 protected function beforeRender()
 {
     $this->template->auth = $this->auth;
     $this->template->categories = $this->tags->findMainTags();
     $this->template->tags = $this->tags;
 }