CodeIgniter Forums
Calling method of other class - 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: Calling method of other class (/showthread.php?tid=31453)

Pages: 1 2


Calling method of other class - El Forum - 06-20-2010

[eluser]Filippo Toso[/eluser]
[quote author="bapobap" date="1277045915"]I need to call certain methods based on the request method. So let's imagine a class called Cupcake where you can bake or eat a cupcake.[/quote]

What about a "pre_system" hook?

You can change the REQUEST_URI in the hook depending on the request method. As the pre_system hook is fired before the URI class creation, it should work almost transparently.

Using a custom configuration file and some routing logic you should be able to get a fairly flexible solution.


Calling method of other class - El Forum - 06-20-2010

[eluser]bapobap[/eluser]
That's a good idea actually, thanks for your help. Glad I'm able to resurrect all my work somehow!