How to create new variable in moodle

Re: How to create new variable in moodle

by Renaat Debleu -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Perhaps implementing a settings.php in your theme or block can be an idea:

$chk = new admin_setting_configtext( 'theme_xxx/chk', 'variable', 'help for variable', 'defaultvalue');
$chk->set_updatedcallback('theme_reset_all_caches');
$settings->add($chk);

The value of this setting can be queried everywhere using $setting = get_config('theme_xxx', 'chk')