[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jfw] Re: Refactored View Package

I like it. Simple and clean.


On Monday, March 9, 2015 at 5:28:35 PM UTC+2, Michael Babker wrote:
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.


Framework source code: https://github.com/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.