[Solar-talk] Composite views

Rodrigo Moraes rodrigo.moraes at gmail.com
Sat Nov 3 10:05:15 CDT 2007


On Nov 2, 2007 10:13 PM, Paul M Jones wrote:
> Looking at it now, it appears like any other controller/view setup.
> In fact, if the widgets were just other page controllers, you might
> do this:
>
>      $widget = Solar::factory('Vendor_App_News');
>      $this->latest_news = $widget->fetch('latest');  // hits the
> actionLatest() method

Paul,
I loved this idea, tried it, and it indeed it still seems really lovely.

I made an full example of an app working with embedded sub-apps [1].
Just checkout tipos' /examples/widgets directory to get all things
needed. Add Tipos_App to Solar_Controller_Front 'classes' config key
and access the /widget app [2]. Done - it is really simple but just a
proof of concept.

The app sets no real content, just fetches contents from "widget apps"
and add them to page slots: News, Feeds and Products, each one a
controller which extends the "lightweight" page controller [3]. The
base controller is not *totally* lightweight because I wanted to keep
the most basic Solar_Controller_Page API. Removed hooks etc but some
basic methods were kept.

Wow, I think this is very adorable and exactly what I needed. :)

Andreas, omg see, very "normalized" components! This is practically a
pot full of strawberries and bacon. ;)

Let me know if you have suggestions.

-- rodrigo
PS: included is also a YUIGrids example app, mainly used to serve as
base for the layout skeleton.

[1] http://tipos.googlecode.com/svn/examples/widgets/
[2] http://tipos.googlecode.com/svn/examples/widgets/Tipos/App/Widget.php
[3] http://tipos.googlecode.com/svn/examples/widgets/Tipos/Controller/Widget.php


More information about the Solar-talk mailing list