+1
It would be cool to see such kind of tools in arsenal.
Why do we need this?
Sometimes (almost always) developer needs to render complex logic in some area in layout (view) and it requires some sort of requests to db and session storage, do some business logic, prepare params for view and render view with this params.
Say we have volt function named component('foo/bar');
This call will invoke FooController::barAction (or FooController::barComponent for clarity).
Here is example of what I mean:
//volt
{{ component('robots/cool', params) }}
//php, controller
$robots = Robots::findCoolRobost() //do request to db, or session storage, or file
//do business logic
//specify view params
$this->pick('cool_robots'); //render view
Here is some examples of common tasks for such feature:
{{component('user/availableActions', user)}}
{{component('product/similar', product)}}
{{component('product/popular', category)}}
{{component('product/similar', product)}}
{{component('page/submenu', page)}}
...
Is this called HMVC?