proxima-cms / core

Proxima CMS - A Kohana 3 powered content management system
http://cms.proxima.cc
MIT License
2 stars 0 forks source link

Change components logic #5

Open badsyntax opened 12 years ago

badsyntax commented 12 years ago

Consider using HMVC.

The main problem we have right now is that a component should be a view_model, but currently a component is required to access the request, and we dont want a view model to access the request. So it seems creating controllers for the components, and then using HMVC to get the output of the controllers is the best bet here that fits in the application design.

Consider not adding in components until 0.2.

We can pass request data to the initial request like so:

if ($this->request !== Request::initial())
{
    $data = Request::initial()->query();
}
else
{
    $data = $this->request->query();
}

Warning! See here: http://forum.kohanaframework.org/discussion/comment/70030#Comment_70030

Further reading, supporting the "components are internal requests" design:

We can continue to use the 'Component' class for managing components and internal requests.

We can also consider not using internal requests for components, but just view_models and views, this should be configurable at a component generation level.