Welcome Guest, Not a member yet? Register   Sign In
call one controller to another controller

I want to call to one controller function to another function,it gives error

First controller name is status

second controller name is Users



1) You cannot load controllers that way
2) You are not meant to "call" one controller from another

If you have functionality in controller A that you wish to use in controller B, then have B extend A, so that the function is then part of B.

You mix up controllers and libraries.
A library is a class with methods (functions) you can use in any controller where you load that library.

A controller always extends the CI_Controller class (or MY_Controller). That's why CI recognizes it as a controller.
The methods inside a controller are triggered by the url that you are using, or from within the controller itself.

Libraries must be located in the libraries folder.
The methods of the library are available after loading the library (in your controller).
More info: https://www.codeigniter.com/userguide3/g...aries.html


It also might do you some good to do the CI tutorial ( https://codeigniter.com/user_guide/tutorial/index.html ).

I think you need HMVC.


Quote:Modular Extensions makes the CodeIgniter PHP framework modular. Modules are groups of independent components, typically model, controller and view, arranged in an application modules sub-directory that can be dropped into other CodeIgniter applications.

HMVC stands for Hierarchical Model View Controller.

Module Controllers can be used as normal Controllers or HMVC Controllers and they can be used as widgets to help you build view partials.

Theme © iAndrew 2016 - Forum software by © MyBB