Welcome Guest, Not a member yet? Register   Sign In
I'm not sure if I've done this properly?
#1

[eluser]JitsunRO[/eluser]
I've tried to make myself a simple CMS type application with CI and I've managed to do fairly well ( I think!) in that I've achieved most for the small goals I set.

I wanted a solution that would allow me to load modules in a sidebar (or any other designated) position, on different pages all with the same template. ie main menu loads on all pages, login module loads only on main.

So, I've setup a few tables and have all the queries in place to work out which modules I am to load when the page loads up.

index.php-> loads login and main menu.
index.php/blog-> loads main menu.

I have set it all up in a small plugin that executes on autoload.
plugin converts page url to id.
checks id to see which, if any, modules are published to that page.
gets module id and checks position that the module is to be loaded.

The end result for the plugin (if you're on the main page)
Code:
$left = array('login, advert, polls');
$header = array('mainmenu');

if you're on the blog page:
Code:
$left = array('');
$header = ('mainmenu');

This is where I'm stuck, and it's probably a fairly simple solution.
How do I now get those $left and $header arrays FROM my auto loaded plugin back to my Controller to send through to my template?
(my template will load as such ( if ( $left ) { execute all left modules }


Code:
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();
    }
    
    function index()
    {
            $data['heading'] = "it seems to work";
            $this->load->view('template', $data);
    }
}
Any help on this greatly appreciated.

Thanks,

Justin


Messages In This Thread
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 05:26 AM
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 08:39 AM
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 08:55 AM
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 09:37 AM
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 09:42 AM
I'm not sure if I've done this properly? - by El Forum - 09-02-2008, 05:47 PM
I'm not sure if I've done this properly? - by El Forum - 09-03-2008, 06:49 PM
I'm not sure if I've done this properly? - by El Forum - 09-03-2008, 09:41 PM
I'm not sure if I've done this properly? - by El Forum - 09-04-2008, 12:23 AM
I'm not sure if I've done this properly? - by El Forum - 09-04-2008, 07:59 AM
I'm not sure if I've done this properly? - by El Forum - 09-04-2008, 09:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB