public function index($parent_id = NULL) { //set the title of the page $this->template->title(lang('web_category_list')); //find all the categories with paginate and save it in array to past to the view $this->template->set("categories", Category::findby($parent_id)); $this->template->set("category_id", $parent_id); $this->template->set('category', Category::find($parent_id)); //load the view $this->template->append_metadata("<script src='js/sortertables.js' type='text/javascript'></script>"); $this->template->build('categories/list'); }