I have think on idea for widget for Joomla. Widget is an interface to display data but in Joomla we have modules so we can construct usign Fluent Interface a Widget DSL.

Widget
- Layouts
- Display Type(Html, json, etc)

The idea is use this for modules in Joomla! like that:

$widget = new JWidget();
$widget->module('content')->setData('rows', $contentData)->layout('default')->display();

This will use module like widget you can create reference for data usign setData, if want set layout and execute display. This will show module for you independent of Application(Site/Administrator). Now back to my Fluent Application you can use this for easly display datas usign domain like that:

$contentData = $content->lists()->published()->latest()->limit(0,5)->getRows();
$widget->module('content')->setData('rows', $contentData)->layout('listItens')->display();

The bease of this JWidget class is manipulate JViews using Fluent Interface and maybe change something.

Views: 123

Tags: DSL, FluentInterface, JWidget

Comment

You need to be a member of All Together, As A Whole to add comments!

Join All Together, As A Whole

Badge

Loading…

© 2012   Created by Amy Stephen.

Badges  |  Report an Issue  |  Terms of Service