![]() |
Hooks and Classes - do not require method name - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Hooks and Classes - do not require method name (/showthread.php?tid=11614) |
Hooks and Classes - do not require method name - El Forum - 09-16-2008 [eluser]drewbee[/eluser] Hello, I am currently working on writing a pre-system hook and want to use the class'es invoking constructor call as the only item that get executed, IE not defining a method to run as well. The constructor will run everything. Is there any reason why this function argument is required? hooks/referral.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); config/hooks.php Code: // Nope... Both these examples above produce an error. First: Fatal error: Call to undefined method Referral: ![]() Second: 'method name must be a string'. I guess at the very least I could create a returnFalse() method as the default method which will do nothing but return false. Thoughts? |