[英]Moodle event in local customisation
我正在為我的心情編寫本地自定義代碼。 當用戶注冊課程時,應該趕上該事件。 但是什么也沒發生
這是我的代碼:
lib.php:
<?php
defined('MOODLE_INTERNAL') || die();
function local_newenrollment_user_enrolled($tbc) {
echo "I m here";
return true;
}
event.php
<?php
defined('MOODLE_INTERNAL') || die();
$handlers = array (
'user_enrolled' => array (
'handlerfile' => '/mod/forum/lib.php',
'handlerfunction' => 'forum_user_enrolled',
'schedule' => 'instant',
'internal' => 1,
),
);
版本.php
<?php
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014012901; // Plugin version.
$plugin->requires = 2013051402; // Moodle version.
$plugin->component = 'local_newenrollment'; // Full name of the plugin (used for diagnostics).
有人可以幫忙嗎?
您已將要調用的函數聲明為“ forum_user_enrolled”,但已創建的函數稱為“ local_newenrolment_user_enrolled”。 您還聲明了該函數在'mod / forum / lib.php'中,而不在插件的lib文件中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.