I'm using the latest Grocery CRUD (version 1.4.1).
I want to integrate a custom template and I have configured my files as follows:
I created an includes directory in views, which contains the following files:
- header.php - contains header files like js,css...
- footer.php - contains footer files
- template.php - loads header, content and footer
My template.php looks like this:
<?php $this->load->view('includes/header'); $this->load->view($content); $this->load->view('includes/footer');
This is how I call them from the controller:
public function index() { $data['content'] = 'index'; $this->load->view('includes/template', $data); }
After using Grocery CRUD, my controller looks like this:
class Users extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('grocery_CRUD'); } public function output($output = null) { $this->load->view('output_view',$output); } public function index() { $this->output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); } public function view() { try { $crud = new grocery_CRUD(); $crud->set_theme('twitter-bootstrap'); $crud->set_table('users'); $crud->... $output = $crud->render(); $this->output($output); } catch(Exception $e){ show_error($e->getMessage().' --- '.$e->getTraceAsString()); } } }
I went through one of the threads (Template controller to grocery CRUD). It didn't seem to work.
How do I integrate my custom template with Grocery CRUD?