-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Forward
Category:Library::Controller | Category:Library::Community
Forward allows you to jump from one controller to other once the execution of the first is finished.
CodeIgniter 1.6.2
Core codeigniter/CodeIgniter.php libraries/Controller.php libraries/URI.php
Example application/controllers/test.php application/controllers/welcome.php
You must overwrite the 3 CI files listed in included files in Core. If you have a local modification of them, back up your files before.
Your controllers will have a method named "forward" which receives an arbitrary number of parameters. Once the controller execution is finished, CodeIgniter will continue executing the forwarded method.
The parameters can be: an URI string (for example "welcome/index/argument") many strings (for example "welcome", "index", "argument") an array with strings (array("welcome", "index", "argument"))
Any of these examples will generate the same URI. The URI will be routed using your custom route rules. If any of the forwarded controllers is not found, a 404 error page will be displayed. Also, all loaded models and libraries will persist on the forwarded CI object.