This Hook help to register Site Setting definition.
Step1: Register Call call back. See below format:
App::Module('Hook')
->setHookName("Sitesettings")
->setAction("register_definition")
->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 an array of path list.
See below example:
class Component_Appstore_Register extends appRain_Base_Component
{
public function init(){
App::Module('Hook')
->setHookName('Sitesettings')
->setAction("register_definition")
->Register(get_class($this),"register_sitesettings_defination");
}
public function register_sitesettings_defination()
{
$srcpaths = Array();
$srcpaths[] = $this->attachMyPath('sitesettings/settings.xml');
return array('filepaths'=>$srcpaths);
}
}