Hi guys,
class MyAjax {
public function __construct() {
/*session_name('MoodleSession');
session_start();
echo session_id();*/
}
public function test() {
define('AJAX_SCRIPT', true);
require_once('config.php');
//require_login();
echo $_SESSION['USER']->id;
}
}
Can someone please provide me some information about how to write a moodle ajax controller.
I need to get the login data and do some database stuff. When i uncomment req_login() i get a error message :(
Thank you.