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.
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...'));
$page->addOutputExtender('head',$extender);