/** * ajax filter function - takes the incoming string, matches against columns * and outputs view of the matching data */ public function filters() { $this->use_layout = false; $cat = new CmsCategory(); if (strlen($fil = $_POST['filter']) < 1) { $this->all_categories = $cat->order("name ASC")->all(); } else { $this->all_categories = $cat->filter("name LIKE '%{$fil}%'")->order("name ASC")->all(); } $this->cat_partial = $this->render_partial("cat_list"); }
public function category() { $this->use_view = "cms_list"; if (!($this->this_page = Request::param('page'))) { $this->this_page = 1; } if (!($url = Request::param('id'))) { $this->redirect_to('/'); } $cat = new CmsCategory(); $this->category = $cat->filter(array('url' => $url))->first(); if (!$this->category->id) { $this->redirect_to('/'); } $this->cms_content = $this->category->attached_to->order('published DESC')->page($this->this_page, $this->per_page); $this->section_stack[0] = "category"; }