I had similar instances on where I had to do this on my application.
I think this also works with CSS, and others.
This really does work Pretty cool Now we do not have to put all those if-conditions in the layout.
For headScript, headMeta and headLink to work, you must echo headScript(), headMeta() and headStyle() respectively in the layout head tag.
<?php // application/layouts/scripts/layout.phtml echo $this->doctype() ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php echo $this->headMeta() ?> <?php echo $this->headScript() ?> <?php echo $this->headStyle() ?> </head> <body>