I've defined a hook in config/hooks.php
something like below:
$hook['post_controller'][] =
array(
'class' => 'notify',
'function' => 'sendEmail',
'filename' => 'notify.php',
'filepath' => 'controllers'
);
Now this hook function will run after each controller's method executed. And it's running the way I want it to run. So upto this everything is fine.
Now let say I have a controller called dashboard
and a method in it called index
. In the index method I'm calling different model method and fetching data and storing it with different variables.
Now I want to use those variable in my hook notify-sendEmail
method.
I'm not sure if this is even possible or not. If it is possible and anyone has done that kind of functionality please help me!
Basically my question is : Can we access all object data from current controller method in hook controller method.