How to pass additional information to a core template?

Re: How to pass additional information to a core template?

by Gareth J Barnard -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
If it's in a 'classes' folder then it can be overridden using autoloading - https://docs.moodle.org/dev/Automatic_class_loading.
In reply to Gareth J Barnard

Re: How to pass additional information to a core template?

by Sarath P -
Hi Gareth,

Thanks. I tried the following:

Copied the course_summary_exporter.php file from /course/classes/external/course_summary_exporter.php and placed it in /theme/photo/classes/external/course_summary_exporter.php and made the following changes which I did in the core code to check whether it's working. I also tried placing the file in the /theme/photo/classes/output folder.

$myid = '2';
return array(
....
....
'progress' => $myid,
....
....
);
But it didn't work.

Here is the code:

namespace core_course\external;
//namespace theme_photo\output\external;
defined('MOODLE_INTERNAL') || die();

use renderer_base;
use moodle_url;

//class course_summary_exporter extends \core\external\exporter {
class course_summary_exporter extends \core_course\external\course_summary_exporter {
....
....
protected function get_other_values(renderer_base $output) {
...
...
$myid = '2';
return array(
...
'progress' => $myid,
...
);
}
}


Could you please check and tell me where I made the mistake and how to correct it?