Kohana 3.0's HMVC structure in layman's terms?

HMVC is better suited to Widgets. For example, a Calendar widget might have its own controller, models, and set of views, and you can simply call its controller to render a certain view from inside the main page to embed the widget The emphasis is on reusable GUI elements. See here for additional reading: javaworld.com/javaworld/jw-07-2000/jw-07... Edit: Here's an actual PHP-centric link: techportal.ibuildings.com/2010/02/22/sca... Seems to have nicer illustrations as well.

– soren. Qvist Jun 10 '10 at 17:21 1 People say that HMVC is more scalable, but it depends what your site is like. Just because a site is large scale doesn't mean it has widgets, or vice-versa.

– Lotus Notes Jun 10 '10 at 17:25.

You can make a request for a page (controller and action is found by the routes) internal. You can do this for example: class Controller_Menu extends Controller { public function action_index() { $this->request->response = view stuff ... $this->request->response->set('...', ...) // some vars } } and class Controller_Home extends Controller { public function action_index() { $this->request->response = ...; // some view stuff... $this->request->response->set('menu', Request::factory('menu')->execute()->response // here happens the magic ); } } Every page who haves a menu don't have to do all the logic to load the menu etc. (e.g. From models). You just make a request to the controller, execute it, and get the result.

Very usefull when used correctly.

I think I got it now :) That's actually very handy. Thanks – soren. Qvist Jun 10 '10 at 17:25.

People on the KO3 forums have described the HMVC ability like making an AJAX Request without the extra HTTP Request. A real world case maybe if you want to build a system that has an API as an integral part of the application. Twitter for example.

With HMVC you could write the API first, and then use that within the application. This saves either code duplication or an extra HTTP Request. At the moment though, working in this way is quite limited, mainly because of the type of requests that can be sent.

Here is a forum post that I made a little while ago with regards to this. It may clarify how HMVC could be useful.

HMVC is better suited to Widgets. For example, a Calendar widget might have its own controller, models, and set of views, and you can simply call its controller to render a certain view from inside the main page to embed the widget. The emphasis is on reusable GUI elements.

See here for additional reading: http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc.html. Edit: Here's an actual PHP-centric link: http://techportal.ibuildings.com/2010/02/22/scaling-web-applications-with-hmvc/. Seems to have nicer illustrations as well.

HMVC is better suited to Widgets. For example, a Calendar widget might have its own controller, models, and set of views, and you can simply call its controller to render a certain view from inside the main page to embed the widget.

You can make a request for a page (controller and action is found by the routes) internal. You can do this for example.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions