public function view($term_taxonomy_id = NULL) { Model::autoloadModel('country'); $model = new CountryModel($this->db); $this->para = new stdClass(); if (isset($_POST['country'])) { $this->para->term_taxonomy_id = $_POST['country']; } elseif (isset($term_taxonomy_id) && !is_null($term_taxonomy_id)) { $this->para->term_taxonomy_id = $term_taxonomy_id; } if (isset($this->para->term_taxonomy_id)) { $this->view->countryBO = $model->get($this->para->term_taxonomy_id); $this->view->parentList = new SplDoublyLinkedList(); $model->getAllSorted($this->view->parentList, $model->buildTree($model->getAll("country")), -1); if (isset($term_taxonomy_id) && !is_null($term_taxonomy_id)) { $this->view->render(RENDER_VIEW_COUNTRY); } else { $this->view->render(RENDER_VIEW_COUNTRY, TRUE); } } else { header('location: ' . URL); } }