So I have a template class that I load with the autoloader. I will use this throughout my controllers to load template files. I want to make a post_controller hook so that after the controller is done, the template will be viewed. The problem is that when I use the hook, it just makes a new template class - so it doesn't have the loaded template files.
So, how can I use a class with a hook without reinstantiating the class?
How it's used in a controller:
function index()
{
$this->tpl->load('test');
}
My hook:
$hook['post_controller'] = array(
'class' => 'Tpl',
'function' => 'view',
'filename' => 'Tpl.php',
'filepath' => 'libraries'
);