Question

i have recently downloaded grocery from their site and i am having a small problem in loading views with a template .. as in controller the function of loading view look like this

function _example_output($output = null)
{
    $this->load->view('groceryView.php',$output);
}

function index()
{
    $this->_example_output((object)array('output' => '' , 'js_files' => array() ,'css_files' => array()));
}

what i want to try to implement is this

$data['main_content'] = 'groceryView';
$this->load->view('dashboardTemplate/template',$data);

i dont know if i do this how can i pass output ... as it gives me an error if i do this

$data['output'] = 'output';
Was it helpful?

Solution

Well you can load multiple views . You need to modify _example_output. If you have header and footer seperately you could load it like this.

function _example_output($output = null)
{
    $this->load->view('header.php');
    $this->load->view('groceryView.php',$output);
    $this->load->view('footer.php');
}   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top