Welcome Guest, Not a member yet? Register   Sign In
Load default views
#7

[eluser]griffithtp[/eluser]
[quote author="Wogan" date="1227060956"]Thanks, but after using the word "hook", I thought there might be an easier way. Turns out there was.

In config/config.php, set $config[enable_hooks] = TRUE (line 91). Then in config/hooks.php, I added:

Code:
$hook['post_controller'] = array(
'class'    => 'Customhooks',
'function' => 'global_footer',
'filename' => 'Customhooks.php',
'filepath' => 'hooks',
'params'   => ''
);

Then in application/hooks, I created Customhooks.php, with the following code:

Code:
class Customhooks extends Controller
{

    function global_footer()
    {
        $this->load->view('global_footer');
    }

}

And bingo. It worked Smile[/quote]
This is great and works!
HOWEVER, it doesn't load libraries anymore.
Code:
$this->session->userdata('logged_user');
or
Code:
$this->load->library('userlib');
$this->userlib->getdetails();
If userlib is loaded in the autoload, it then works. BUT session is also loaded in autoload.php and still doesn't recognise $this->session as it seems it isn't loaded.
Code:
$this->session->userdata('logged_user'); //<--- this is called in the header hook..


Messages In This Thread
Load default views - by El Forum - 11-18-2008, 02:02 PM
Load default views - by El Forum - 11-18-2008, 02:11 PM
Load default views - by El Forum - 11-18-2008, 02:15 PM
Load default views - by El Forum - 11-18-2008, 02:32 PM
Load default views - by El Forum - 11-18-2008, 03:00 PM
Load default views - by El Forum - 11-18-2008, 04:22 PM
Load default views - by El Forum - 11-25-2008, 08:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB