What are outputextenders?

Outputextenders are used to embedd various types of resources, such as CSS styles or JS scripts. Currently there are two types of outputextenders: singleton and prototype. Singleton outputextenders will be shown once, regardless of how much you have registered under the same key, while prototype outputextendes will be shown as often as you have registered them.

How to use outputextenders

Create a new outputextender. (Note: you don't have to include any *.php files because outputextenders are part of cube/controller.php).
Every outputextender holds a cube_node, which holds the actual code to embed.


$extender = &new cube_singletonOutputExtender(new cube_node('some code here...'));

Register the outputextender at the cube_page under a specific key.

$page->addOutputExtender('head',$extender);

How to use the taglib

Include the taglib in your cube stylesheet


<cube:addTagLib namespace="cube.apps.ui" file="outputextender" prefix="extn"/>

Embedd the taglib in your html code, where the outputextenders for the given key should appear.

<extn:outputextender extenderKey="head"/>