Welcome Guest, Not a member yet? Register   Sign In
hmvc partial views
#1

[eluser]RJ[/eluser]
I have a dashboard that contains several partials, the only way I found to load these partials in the controller is:

The display controller:
Code:
private function _dashboard()
        {
                $glimpse = $this->load->module('glimpse');
                
                $this->template
                        ->set('glimpse', $glimpse->load())
                        ->build('dashboard');
        }

Then in glimpse I have:
Code:
function load()
    {                
        return $this->load->view('g_profile', true);
    }

I have to do the same thing to display a simple login box, but I don't like having to setup a separate method in the module controller to return these views. I also don't want to do Modules::run() in the view (logic should be in controller imho).

What method do you use to load partial views from one module to the next?
#2

[eluser]seanloving[/eluser]
I think you can call modules::run directly from your controller like this (untested):

Code:
private function _dashboard()
        {
                $glimpse = $this->load->module('glimpse');
                $load = modules::run('glimpse/load');
                
                $this->template
                        ->set('glimpse', $load)
                        ->build('dashboard');
        }

-seanloving
#3

[eluser]RJ[/eluser]
I'll give it a whirl. Thank you for commenting on this old post :-)




Theme © iAndrew 2016 - Forum software by © MyBB