Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how load model in another modules in hmvc in codeigniter?

I want to use The Modular Extensions HMVC in my Project like this:

modules  
      module01
            models
                models01.php
            controllers
                controller01.php
            views
                views01.php
      module02
            models
                models01.php
            controllers
                controller01.php
            views
                views01.php
      ‘
      ‘

and i want use 'models01.php' from module01 , is there any way?

like image 770
aya Avatar asked Feb 11 '13 09:02

aya


People also ask

How you can add or load a model in CodeIgniter?

If you find that you need a particular model globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload. php file and adding the model to the autoload array.

Can we load library in model CodeIgniter?

Yes, but loading libraries where they're needed minimizes dependency issues.

What is modular HMVC why should I use it explain?

What is Modular HMVC, why should I use it? A. Modular HMVC = Hierarchy of multiple MVC triads. Firstly, This is most useful when you need to load a view and its data within a view. Think about adding a shopping cart to a page.

What is the use of model in CodeIgniter?

In CodeIgniter Model are the PHP classes where all database related manipulation is done e.g. fetching records, insert, update, and delete records. Within this, all data processing logic is done. All model files are managed in application/models directory and they are load and access by the controller.


1 Answers

$this->load->model("module01/models01");

You can call any models from any module like this. Tested.

like image 85
Mansoorkhan Cherupuzha Avatar answered Sep 22 '22 15:09

Mansoorkhan Cherupuzha