Welcome Guest, Not a member yet? Register   Sign In
Admin Template
#1

[eluser]Evollution[/eluser]
I'm using Modular Extensions - HMVC ..
and for including my template i use code:

Code:
function index()
    {
        $data['main_content'] = 'adminmain';
        $this->load->view('includes/template', $data);        
    }

now what shoud i do if my function looks like :
Code:
function index(){
        $data = array();
        if($query = $this->radio_m->get_records()){
            $data['records'] = $query;
        }
        $this->load->view('admin/statii', $data);
    }

how can i add $data[main_content] to this function
#2

[eluser]InsiteFX[/eluser]
You can do this for all your views, it makes all the view variables accessable to all views.
Code:
$this->load->vars($data);

$this->load->view('admin/statii');

See the CodeIgniter User Guide Loader Class

InsiteFX
#3

[eluser]ramm[/eluser]
Code:
function index(){
        $data = array();
        if($query = $this->radio_m->get_records()){
            $data['records'] = $query;
        }
        $data['main_content'] = 'adminmain';
        $this->load->view('admin/statii', $data);
    }




Theme © iAndrew 2016 - Forum software by © MyBB