Hmvc of codeigniter

Source: Internet
Author: User

Hmvc(Hierarchical-Model-View-Controller). It can also be called layered MVC. The so-called MVC model is classified by level. The simple explanation is that MVC is subdivided into multiple sub-MVC, and each module is divided into one MVC.

The advantage of using hmvc is that it can reduce coupling between functional modules and improveCodeReusability makes every function Independent. Each module has its own MVC structure, which is a bit like ActiveX Control. Each control has its own behavior, and controls do not affect each other.

 
Codeigniter Structure Diagram
 
Application |-controllers |-controllers1.php |-controllers2.php | -... |-models |-models1.php |-models2.php | -... |-views |-views1 |-index. PHP |-footer. PHP | -... |-views2 |-index. PHP |-footer. PHP | -... | -...
 
The above is the original codeigniter structure. If it is hmvc, the structure is:
 application |-modules |-modules1 |-controllers. phpci |-models. PHP |-views |-index. PHP |-footer. PHP | -... |-modules2 |-controllers. PHP |-models. PHP |-views |-index. PHP |-footer. PHP | -... | -.... |-controllers | -... |-models | -... |-views | -... 

note that the above is only a manifestation of the hmvc folder structure of the codeigniter framework. It does not mean that hmvc must follow this structure. Language or framework to design its hmvc structure.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.