General developer forum

Regarding myoverview block overriding in theme

 
Picture of Ravi kumar
Regarding myoverview block overriding in theme
 

Hello everyone,

 I want to override myoverview block renderer at custom theme in moode3.3. I have created renderers.php under root of my custom theme.  Followings are the code of renderes.php, which is not working,

namespace block_myoverview\output;

defined('MOODLE_INTERNAL') || die;

require_once($CFG->dirroot . '/blocks/myoverview/classes/output/renderer.php');

class theme_vakmoodle_renderer extends renderer {

      public function render_main(main $main) {

       //return $this->render_from_template('block_myoverview/main', $main->export_for_template($this));

       return 'hello';

    }

}

Please guide me to override the myoverview block renderer.

 
Average of ratings: -
Picture of Fabio Uzeltinger
Re: Regarding myoverview block overriding in theme
 

theme/vakmoodle/classes/output/block_myoverview_renderer.php

namespace theme_vakmoodle\output;
use block_myoverview\output\main;
class block_myoverview_renderer extends \block_myoverview\output\renderer {
    public function render_main(main $main) {
        return 'done';
    }
}


please, let me know if is correct

 
Average of ratings: -