Re: [jfw] Digest for joomla-dev-framework@googlegroups.com - 2 updates in 1 topic

26 views
Skip to first unread message

Joseph Cardwell

unread,
Mar 9, 2015, 6:11:48 PM3/9/15
to joomla-dev...@googlegroups.com
So the controller would be required to initialize an instance of the RendererInterface?

On Mon, Mar 9, 2015 at 2:43 PM, <joomla-dev...@googlegroups.com> wrote:
Michael Babker <michael...@gmail.com>: Mar 09 11:28AM -0400

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 <bzz...@gmail.com>: Mar 09 08:49AM -0700

I like it. Simple and clean.
 
Dmitry
 
On Monday, March 9, 2015 at 5:28:35 PM UTC+2, Michael Babker wrote:
You have received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to joomla-dev-frame...@googlegroups.com.

Michael Babker

unread,
Mar 9, 2015, 6:25:40 PM3/9/15
to joomla-dev...@googlegroups.com
It wouldn't be required.  The sample code linked in to my repo was built to more easily switch between the different renderers by changing a config option.  You could just include the service provider building your renderer at the same time you populate your DI container with your other app providers and it would all work fine.

--
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-frame...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.

Reply all
Reply to author
Forward
0 new messages