public function user_navigation() { $view = new XView(Navigation_View); $view->title = 'Craiglist | ' . 'Main Page'; $model = new CategoryModel(); $view->categories = $model->getCategoryTree(-1); $model = new ArticleModel(); $view->total_groups = ceil($model->getCount() / $this->items_per_group); $this->__common($view); }
public function article($substring) { if ($substring == NULL) { return; } $view = new XView(Article_List); $view->title = 'Searching...'; $view->articles = ArticleModel::getArticlesByTitle($substring); $view->articles_number = count($view->articles); $this->__common($view); }
public function remove($id) { ArticleModel::removeArticle($id); $this->view($id); // header('Location:' . SERVER_ROOT_URL . '/article/view/' . $id ); }