php - how to load a variable of an module in dashboard -


i using pyrocms , have module , in have controller, getting values in $var defined in function index(), how load controller in different module, have use variable in controller in dashboard view

here controller code in module a

public function index() { $data = $this->recent(); } 

dashboard.php view file

<div class="accordion-body collapse in lst" style="overflow: auto;"> <?php print_r($data );?> </div> not getting $data in dashboard.php 

according documentation, should this:

public function index() {     $data = $this->recent();     $this->template         ->set('data', $data)         ->build('dashboard'); } 

edit:

to have module load data when user visits dashboard need use events. following hook should called when loading dashboard.

events::register('admin_controller', array($this, 'run')); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -