Use MVC in block

Use MVC in block

by Tài Liệu Thực Hành -
Number of replies: 0
I'm a newbie to this forum and looking forward to learn Moodle.

I created block: "simplehtml", in my block:

  1. block_simplehtml.php
    <?php

    class block_simplehtml extends block_base {
    ...
        public function get_content() {
        ....
             $data = ...;
              $this->content = WHAT_FUNCTION_CALL( 'view', $data);  //render html from view_file_php
        ....
        }
    ...
    }

    ?>
  2. view.php

       <div>
           //Write your code here      
         <?php $data....blabla?>
        </div>

Please give me some suggestion what function I can do it. (WHAT_FUNCTION_CALL????)


(Moodle 2.9)

Average of ratings: -