This Hook help to register a new InterfaceBuilder. We have to register it in two step.
Step1: Register Call call back. See below format:
App::Module('Hook')
->setHookName("InterfaceBuilder")
->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 with a list of interface builder. See below format:
$srcpaths[] = array(
'path'=>Path
);
Name |
Type |
Description |
---|---|---|
Path |
Mandatory |
File path of the definition. |
See below example:
class Component_Appstore_Register extends appRain_Base_Component
{
public function init(){
App::Module('Hook')
->setHookName('InterfaceBuilder')
->setAction("register_definition")
->Register(get_class($this),"register_interface_builder_defination");
}
public function register_helper()
{
$srcpaths = Array();
$srcpaths[] = $this->attachMyPath('interface_builder/blog.xml');
return array('filepaths'=>$srcpaths);
}
}