Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 6 revisions

[h3]Introduction[/h3]

Forward allows you to jump from one controller to other once the execution of the first is finished.

[h3]Requirements[/h3]

CodeIgniter 1.6.2

[h3]Download[/h3]

File:forward_1.6.2-0.1.zip

[h3]Included files[/h3]

[b]Core[/b] codeigniter/CodeIgniter.php libraries/Controller.php libraries/URI.php

[b]Example[/b] application/controllers/test.php application/controllers/welcome.php

[h3]Install[/h3]

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.

[h3]Usage[/h3]

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 [b]will be[/b] routed using your custom route rules. If any of the forwarded controllers is not found, a 404 error page will be displayed.

Clone this wiki locally