CSS

Navigation:  Components > Hook >

CSS

Previous pageReturn to chapter overviewNext page

This Hook used to register CSS file.
 
Step1: Register Call call back. See below format:
 
App::Module('Hook')

   ->setHookName("CSS")

   ->setAction("register_css_code")

   ->Register(Call Back Class Name, Call Back Function Name);

 

Name

Type

Description

Call Back Class Name

Mandatory

Class Name of  call back function

Call Back Function Name

Mandatory

Call back function

 

Step 2: Register resource in Call back function:

In call back function we return text content with css code.
 

See below example:
 
class Component_Appstore_Register extends appRain_Base_Component
{
   public function init(){
       App::Module('Hook')
           ->setHookName('CSS')
           ->setAction("register_css_code")
           ->Register(get_class($this),"register_css_code");
 
   }
 
   public function register_css_code()
   {
      return App::Helper('Utility')->fetchFile($this->attachMyPath('addons/css/styles.css'))
       . App::Helper('Utility')->fetchFile($this->attachMyPath('addons/zoom/zoom.css'));
   }
}