Examples of Calling Hooks Functions? |
[eluser]Vik[/eluser]
I've added hooks for Simple Machines Forums to my CI installation, using code provided on this forum by DanFreak. Here's the hooks.php part of that code: Code: $hook['post_controller_constructor'] = array( My question is, how do I call a function from ssi.php? For example, I've tried: Code: $UserIsLoggedIn = smf_authenticateUser(); ...and found that this generates an “undefined function” error. What is the correct way to do this? Thanks very much in advance for any info.
[eluser]Majd Taby[/eluser]
you can tell php that the hooks class is in your helpers folder, then (auto)load it.
[eluser]Vik[/eluser]
I think I may have done that, because I've done all the things DanFreak describes: [quote author="danfreak" date="1175743689"] application/config.php Code: $config['enable_hooks'] = TRUE; application/config/hooks.php Code: $hook['post_controller_constructor'] = array( application/hooks/ssi.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Once you do all that, how do you call one of the new functions? An example would be very helpful. |
Welcome Guest, Not a member yet? Register Sign In |