[eluser]gtech[/eluser]
well if you want to set variables in the hook i have just written a test for you.
hook:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MyClass
{
public function MyFunction($p1)
{
$ci = & get_instance();
$ci->testv = 'hi';
}
}
?>
controller
Code:
<?php
class Temp extends Controller {
function Temp()
{
parent::Controller();
$this->load->library('session');
}
function index()
{
echo $this->testv;
}
}
?>
the temp controller printed out hi
the hook was defined as
Code:
$hook['post_controller_constructor'] = array(
'class' => 'MyClass',
'function' => 'Myfunction',
'filename' => 'Myclass.php',
'filepath' => 'hooks',
'params' => array('anything'));
?>
I loaded it as post constructor so I could get the CI instance to set variables. In theory anything you put in the constructor should be available in the hook using the CI instance.
is that what you are after? (dont forget to enable hooks in the config file)