/** * Parse the page */ protected function parse() { // parse the datagrid for all products $this->tpl->assign('dgProducts', $this->dgProducts->getNumResults() != 0 ? $this->dgProducts->getContent() : false); // get categories $categories = BackendCatalogModel::getCategories(true); // multiple categories? if (count($categories) > 1) { // create form $frm = new BackendForm('filter', null, 'get', true); // create element $frm->addDropdown('category', $categories, $this->categoryId); $frm->getField('category')->setDefaultElement(''); // parse the form $frm->parse($this->tpl); } // parse category if (!empty($this->category)) { $this->tpl->assign('filterCategory', $this->category); } }
/** * Sets an URL, optionally only appending the provided piece * * @param string $url The URL to set. * @param bool $append Should it be appended to the existing URL. */ public function setURL($url, $append = false) { if ($append) { parent::setURL(parent::getURL() . $url); } else { parent::setURL($url); } }