Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How are modules arranged in a codeigniter application?


Asked by Karla Burns on Dec 01, 2021 FAQ



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. This allows easy distribution of independent components (MVC) in a single directory across other CodeIgniter applications.
Just so,
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.
In addition, In this tutorial, we covered three (3) major components that make up a CodeIgniter application. We looked at routes and how to define them, controllers and how to create methods that respond to route requests and created simple views that are returned to the users when they request for a resource.
Similarly,
To use HMVC functionality, such as Modules::run (), controllers must extend the MX_Controller class. To use Modular Separation only, without HMVC, controllers will extend the Codeigniter Controller class. The above file my_form_validation.php should be put into /application/libraries directory.
One may also ask,
Controllers can be loaded as class variables of other controllers using $this->load->module (‘module/controller’); or simply $this->load->module (‘module’); if the controller name matches the module name. Controllers may be loaded from application/controllers sub-directories. Controllers may also be loaded from module/controllers sub-directories.