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