Welcome Guest, Not a member yet? Register   Sign In
How to load view from modul A in controllers modules B in HMVC (Modular Extention)
#1

[eluser]didit[/eluser]
hi need a help again

how to load view from modules A in controller modules B??
for example modules A : templates, modules B : Testing

i used $this->load->view('templates/themes', $this->data); but it not work ! Sad
here my code :
Code:
class Testing extends MY_Controller {
    
    function Testing() {        
        parent::MY_Controller();      
        $this->load->model('testing_model');
        $this->load->model('templates/templates_model');
        
    }
      
    function getall() {
       //$data['header']  = $this->templates_model->getHeader();          
       $this->data['items'] = $this->testing_model->getAll();    
       $this->data['content'] = $this->load->view('viewemployee',$this->data,true);
       // load themes.php from templates modules
       $this->load->view('templates/themes', $this->data);
    }
}

error msg :
Code:
An Error Was Encountered
Unable to locate the file: templates/themes.php

thanks a lot
#2

[eluser]flaky[/eluser]
from the wiki
Quote:Use application/libraries/MX_Controller.php to contain Controller class extensions instead of using MY_Controller.

Use application/libraries/MX_Loader.php to contain Loader class extensions instead of using MY_Loader.
#3

[eluser]didit[/eluser]
hi flaky ,

actually i have rename MY_Controller to MX_Controller, but didn't change the class name, so it stay as it was.
although i have changed the classname from MY to MX, but still got the same error !
FYI, when i remove code $this->load->view('templates/themes', $this->data); system works fine, so? did i miss something??

thanks a lot
#4

[eluser]didit[/eluser]
SOLVED
#5

[eluser]Joey Beltran[/eluser]
Care to share how you solved it.

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB