public function view($term_taxonomy_id = NULL) { Model::autoloadModel('city'); $model = new CityModel($this->db); $this->para = new stdClass(); if (isset($_POST['city'])) { $this->para->term_taxonomy_id = $_POST['city']; } 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->cityBO = $model->get($this->para->term_taxonomy_id); $this->view->countryList = new SplDoublyLinkedList(); $model->getAllSorted($this->view->countryList, $model->buildTree($model->getAll("country")), -1); if (isset($term_taxonomy_id) && !is_null($term_taxonomy_id)) { $this->view->render(RENDER_VIEW_CITY); } else { $this->view->render(RENDER_VIEW_CITY, TRUE); } } else { header('location: ' . URL); } }