_view = $frontController->getBootstrap()->getResource('view'); $this->_request = $frontController->getRequest(); } public function render() { $output = null; $translate = $this->getTranslate(); $settings = Front::getInstance()->getBootstrap()->getResource('settings'); $activeCategory = (isset($this->_attributes[self::ACTIVE_CATEGORY])) ? $this->_attributes[self::ACTIVE_CATEGORY] : null; $storesCategories = (isset($this->_attributes[self::STORES_CATEGORIES])) ? $this->_attributes[self::STORES_CATEGORIES] : false; if ($activeCategory !== null) { $output .= '
'; } $params = $this->_request->getParams( array('parent_id', 'page', 'limit', 'submit', 'category_slug', 'category_name', 'controller', 'action') ); $params = array_filter( $params, function (&$element) { if (is_array($element)) { return array_filter($element) ? true : false; } return (!empty($element)); }); /** @var \Ppb\Db\Table\Row\Category $category */ foreach ($this->_customData['rowset'] as $category) { $counter = $category->getCounter(); if ($counter > 0 || !$settings['hide_empty_categories'] || count($params) > 0 || $storesCategories) { $url = $this->_view->url(array('category_name' => $category['name'], 'parent_id' => $category['id']), null, true, array('category_slug', 'page', 'submit')); $output .= ''; } } $output .= '_endTag; return $output; } }