我正在使用expressionengine v2,我已经按照他们网站上的文档进行了扩展挂钩,我已经在第三方文件夹中创建了一个文件并从cp(控制面板)安装了该文件。现在我不知道如何使用hook调用该函数来显示一些文本。
$hooks = array(
'after_channel_entry_insert' => 'after_channel_entry_insert',
'before_channel_entry_update' => 'before_channel_entry_update'
);
foreach ($hooks as $hook_name => $method_name) {
$data[] = array(
'class' => __CLASS__,
'method' => $method_name,
'hook' => $hook_name,
'settings' => serialize($this->settings),
'priority' => 10,
'version' => $this->version,
'enabled' => 'y'
);
}
//insert data in extension table
ee()->db->insert_batch('extensions', $data);
//now i want to call this function on hook
function after_channel_entry_insert($data = '') {
die('after_channel_entry_insert');
}