Overwrite myprofile renderer

Overwrite myprofile renderer

by Son TRAN -
Number of replies: 0

Dear All,

I would like to overwrite the renderer of myprofile component. But somehow the overwritting class is not involved. 

The parent class is in user/classes/output/myprofile/renderer.php.

I created in the theme directory the source file: theme/<mytheme>/classes/output/core_user/myprofile/renderer.php.

Inside that file I declare my overwriting class as the following:

namespace <mytheme>\output\core_user\myprofile;
include_once($CFG->dirroot . "/user/classes/output/myprofile/renderer.php");

class renderer extends \core_user\output\myprofile\renderer {
 
    public function render_category(category $category) {
     }
}

It seems to me that the function render_category of the class user/classes/output/myprofile/renderer is still called while I click  the My Profile instead of the one from   <mytheme>\output\core_user\myprofile/renderer.

Would you please show me how to overwrite it.
Many thanks




Average of ratings: -