/** * Load the data, don't forget to validate the incoming data */ private function getData() { $categories = FrontendFaqModel::getCategories(); $limit = $this->get('fork.settings')->get('Faq', 'overview_num_items_per_category', 10); foreach ($categories as $item) { $item['questions'] = FrontendFaqModel::getAllForCategory($item['id'], $limit); // no questions? next! if (empty($item['questions'])) { continue; } // add the category item including the questions $this->items[] = $item; } }
/** * Parse */ private function parse() { $this->tpl->assign('widgetFaqCategories', FrontendFaqModel::getCategories()); }