Thursday, January 6, 2011

CakePHP Croogo Plugins CSS.

I had solved how to load plugin css in Croogo CMS.
Simply add these,

in app/plugin/myplugin/views/helpers/myplugin.php
public function beforeRender() {
if($this->Layout->View !== false)
{
$this->Layout->View->addScript($this->Html->css('/myplugin/css/myplugin'));
}
}
and in app/plugin/myplugin/config/myplugin_bootstrap.php
make sure you have declared

// As in Croogo documentation
// Home → Wiki → Developers → Plugins → Hooks
// To hook your plugin's ExampleHelper
// (at app/plugins/example/views/helpers/example.php)
// in ALL controllers:
Croogo::hookHelper('*', 'Myplugin.Myplugin');

Hope it helps, happy baking.

No comments: