Refactored View Package

50 views
Skip to first unread message

Michael Babker

unread,
Mar 9, 2015, 11:28:35 AM3/9/15
to joomla-dev...@googlegroups.com
At https://github.com/joomla-framework/view/pull/6 I'm proposing an essentially fully restructured view package for 2.0.

The design here is that the base view class essentially is only able to render the data it receives, it tries to decouple the logic of the view directly fetching data from a model in favor of the data being injected via a controller.  Note that at this point, the model isn't decoupled from the base implementation (though in practice the apps I've been using this with aren't reliant on the models, it's basically an unnecessary dependency).

There are two base implementations included in the package, one for each HTML and JSON.  The JSON base simply json_encodes the data that has been injected into the class.  The HTML base class is restructured to receive a RendererInterface implementation (https://github.com/babdev/renderer) which is in essence a compatibility layer between the framework and various rendering engines, to include Twig, Mustache, and Plates.  Other implementations are possible, including the CMS potentially consuming this and refactoring JDocument to implement the interface.

Thoughts?

Dmitry Rekun aka b2z

unread,
Mar 9, 2015, 11:49:34 AM3/9/15
to joomla-dev...@googlegroups.com
I like it. Simple and clean.

Dmitry

Adam Bouqdib

unread,
Mar 9, 2015, 3:55:24 PM3/9/15
to joomla-dev...@googlegroups.com
Love it! Nothing to add.
Reply all
Reply to author
Forward
0 new messages