[eluser]Freakish_05[/eluser]
Hello everyone!
I've developed a simple view library that does all the repetative things of putting my header, footer, sidebar and 'view' files together.
I've also coded a plugin which creates my sidebar for me.
I'm trying to load this plugin into my 'view' library but its not having any of it.
Layout.php (view library)
Code:
<?php
if(!defined('BASEPATH')) exit('No direct script access allowed!');
class Layout
{
function Layout()
{
$this->layout =& get_instance();
}
function load_page($headerdata, $page, $data)
{
$this->load->plugin('sidebar');
$sidebar = make_sidebar();
$to_load = $this->layout->load->view('divided/header', $headerdata, true);
$to_load .= $this->layout->load->view('divided/sidebar', $sidebar, true);
$to_load .= $this->layout->load->view($page, $data, true);
$to_load .= $this->layout->load->view('divided/footer', '', true);
echo $to_load;
}
}
The error message I'm getting is
Code:
Fatal error: Call to a member function plugin() on a non-object in D:\Webserver\htdocs\zomg\system\libraries\Layout.php on line 13
In short, its not liking the line
$this->load->plugin('sidebar').
Is there a way to include this plugin into the library? If so, how do I do it? If not I'm assuming that I'll have to use the plugin in the controller and then pass the results back to the 'view' library.
Thanks in advance,
Freakish_05