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'); }
/** * @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; }