This Hook help to register URI Manager definition.
Step1: Register Call call back. See below format:
App::Module('Hook')
->setHookName("URIManager")
->setAction("on_initialize")
->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 re-write url. See below format:
See below example:
class Component_Appstore_Register extends appRain_Base_Component
{
public function init(){
App::Module('Hook')
->setHookName('URIManager')
->setAction("on_initialize")
->Register(get_class($this),"register_newrole");
}
public function register_newrole($def=null)
{
$def['pagerouter'][] = array(
"actual"=>Array("appstore","index"),
"virtual"=>Array("store")
);
$def['pagerouter'][] = array(
"actual"=>Array("appstore","index","bycat"),
"virtual"=>Array("category-view")
);
return $def;
}
}