What is the HMVC ?
Hierarchical-Model-View-Controller (HMVC)
The HMVC pattern decomposes the client tier into a hierarchy of parent-child MVC layers. The repetitive application of this pattern allows for a structured client-tier architecture. Obullo has a simple HMVC library and Obullo's simple HMVC library support internal requests at this time.
MVC
_____________
| |
| Controller |
|_____________|
/ \
_____________ / \ ______________
| | | |
| Model | ---------------- | View |
|_____________| |______________|
HMVC (Layered MVC)
------
| c | -------
------ \
/ \ \
------ ------- \
| m | | v | \
------ ------- ------
| c | ------
------ \
/ \ \
------ ------- \
| m | | v | \
------ ------- ------
| c |
------
/ \
------ -------
| m | | v |
------ -------
HMVC pattern offers more flexibility in your application. You can call multiple requests using Obullo's Request helper.
------------------------------------------------------------------------------------
| |
| echo request('home/start/header')->exec(); |
| |
| |
|-----------------------------------------------------------------------------------|
| |
| |
| echo request('news/start/sports/tennis')->exec(); |
| |
| |
| |
| |
| echo request('news/start/economy/exchange')->exec(); |
| |
| |
| |
-------------------------------------------------------------------------------------
| |
| $footer = request('home/start/footer', $params =array() , $cache = 1000); |
| |
| echo $footer->exec(); |
| |
-------------------------------------------------------------------------------------
Another example, we created a captcha module using hmvc methods download the latest version of Obullo and look at the captcha module. And just an idea you can create a login service creating a login folder then you can do request from your controllers using HMVC. Learn more details about Obullo's HMVC library click Reuest helper link.
