A_funs
A_funs

Reputation: 1246

Codeigniter modular extensions HMVC won't load view

I am using the modular extensions HMVC add on for codeigniter.

my structure looks as follows:

modules/ -manager/ --controllers/ ---manager.php --views/ ---index.php

the manager.php controller:

class Manager extends MX_Controller {

  function __construct(){

    parent::__construct();

  }

  function index(){


   $data['newsletter'] = Newsletter::all();

   $this->load->view('index',$data);

  }

}

Routing and printing from inside the controller itself works fine, but I can't seem to load a view, get a codeigniter error saying the view file can't be found

/modules/manager/config/routes.php:

<?php

$route['module_name'] = 'manager';

It seems the views are still being called from CI's main view folder, not sure why they are not calling from the modules folder because the controller is extending the MX class

Upvotes: 0

Views: 1909

Answers (1)

joni jones
joni jones

Reputation: 2995

Try this:

$this->load->view('manager/index',$data);

Structure for folders:

apllication
    modules
       manager
           config
               routes.php
           controllers
               manager.php
           views
               index.php

Upvotes: 0

Related Questions