我是 codeigniter 的新手。我想加载管理面板控制器的挂钩。
$hook['post_controller_constructor'][] = array(
'class' => 'AdminData',
'function' => 'myfunction',
'filename' => 'loginhelp.php',
'filepath' => 'hooks',
'params' => array()
);
好的,这是最简单的方法:
在您的控制器中声明一个公共变量
public $is_hookable = TRUE;
然后在你的钩子函数中执行以下操作:
$ci=&get_instance();
if($ci->is_hookable){
... enter whatever you want here;
}
希望这有帮助
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)