Hi Stephan,

It's good to see another high level effort breaking the mold. I'd love to see 
the code involved :).

Regards,
Pádraic


 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


----- Original Message ----
From: Stephan Stapel <[EMAIL PROTECTED]>
To: Dinh <[EMAIL PROTECTED]>
Cc: Zend Framework General <fw-general@lists.zend.com>
Sent: Monday, April 23, 2007 6:33:57 PM
Subject: Re: [fw-general] Implementing complex Views with ZF

Hi Dinh,

> It is excellent, Stephan. It is a really good Composite View  
> implementation. Could you share something on how you design it?

yes, sure. That's why I posted it :)
I currently use a programmatic description for the layout, it is stored 
into so-called containers which are built of frames which in turn might 
contain further (sub) containers or portlets.

It basically looks like this:

$container = new ContainerModel(ContainerModel::VERTICAL);        
$container->addFrame("topmenu", "TopMenu", ContainerModel::MAXSIZE);        

$subcontainer = new ContainerModel(ContainerModel::HORIZONTAL, $container);
$subcontainer->addFrame("mainspace", null, ContainerModel::MAXSIZE);
$container->addChild("contentspace", $subcontainer, 
ContainerModel::MAXSIZE);

As mentioned before, containers might be presented horizontally or 
vertically.
The addFrame() command is passed the frame identifier, the portlet 
controller name (might be null) and the sizing.

The rendering is done using the container controller:

$controller = new ContainerController($container);
$controller->setRequestResponse($this->_request, $this->_response);

which is passed to the view.
In the view.tpl.php file,

echo $this->containerController->render();

is called. Using the php DOM parser, I'm replacing all hyperlinks in the 
portlets' html output. That's about it :)

The implementation however is far from being complete. For example there 
is only a limited number of error checks implemented currently, also 
frame size is only supported in a limited why as I'm using tables for 
layouting. div sections are probably better but not yet have time for 
this :/

I'll send the code and the demo in a separate email to not overload the 
mailing list. If someone should also please interested, just drop me a 
message.
I'd love other people using it, improving the code and sending the 
improvements back :)

Regards,

Stephan






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to