Okay, so there is no RenderKit or template parser for the new component
model yet... but, this component was fully passed through the lifecycle so
it counts :)
This is the "template":
==========================
$viewRoot = new PhpFaces_Components_UI_UIViewRoot();
$hello = new PhpFaces_Components_UI_UIOutput();
$hello->setValue("hello, phpfaces!");
$hello->setParent( $viewRoot );
$viewRoot->getChildren()->add( $hello );
return $viewRoot;
==========================
In whatever form, the ViewHandler is responsible for creating this component
tree in its implementation of createView(). This happens to be PHP code, but
different implementations of the ViewHandler can create component trees
however they like.
This is the output it produces in the renderView() function, due to the fact
that there is no RenderKit yet:
==========================
PhpFaces_Components_UI_UIViewRoot Object
(
[viewId:private] =>
[children:private] => ListObject Object
(
[list:private] => Array
(
[0] => PhpFaces_Components_UI_UIOutput Object
(
[value:private] => hello, phpfaces!
[children:private] =>
[parent:private] =>
PhpFaces_Components_UI_UIViewRoo
t Object
*RECURSION*
[isRendered:private] =>
[rendererType:private] =>
)
)
)
[parent:private] =>
[isRendered:private] =>
[rendererType:private] =>
==========================
This particular example uses the, appropriately named,
PhpFaces_ViewHandler_Hardcore ViewHandler. I currently have it running in
the pear unit tests, and it should be committed to the SNV
branches/components today.
Harlan
|