联系官方销售客服
1835022288
028-61286886
新版钩子路径还是/dayrui/hooks/ 这个吗,为什么我的执行文件无效啊,,
这是config/my_hooks.php代码
$hook['content_add_before'][] = array( 'class' => 'hc', 'function' => 'add_content_afater', 'filename' => 'add_content.php', 'filepath' => 'hooks', ); $hook['content_delete'][] = array( 'class' => 'hc', 'function' => 'content_delete', 'filename' => 'add_content.php', 'filepath' => 'hooks', );
/这是/diy/dayrui/hooks/add_content.php文件,钩子执行代码
<?php class hc { public $ci; /** * 构造函数 */ function __construct() { $this->ci = &get_instance(); } // 发布时同步到汇总表 function add_content_afater($data) { $param=array( 'catid'=>$data[0]['catid'], 'cid'=>$data[0]['id'], 'module'=>APP_DIR, 'inputtime'=>SYS_TIME ); $this->ci->db->insert('dr_content_all',$param); } function content_delete($data){ $param=array( 'cid'=>$data['id'], 'module'=>APP_DIR ); $this->ci->db->delete('dr_content_all',$param); // var_dump($data); } }
为啥没效果啊,不执行