Can be method used as id? |
[eluser]AndyBrandy[/eluser]
Hi, Can i use method as id or parameter? I need From this url : example.com/text/programing/1/ go to the class "text" and here goes to index. It's real?
[eluser]Michael Wales[/eluser]
Code: <?php
[eluser]sophistry[/eluser]
You could also do this with the Routing rules. Code: // not tested Be careful if you use _remap() you have to tell your controller what to do with all the other function names that might come in. I think if all you want to do is pass parameters to an index function you are better off with routing.
[eluser]AndyBrandy[/eluser]
I want use this for remap all functions in class. But both sides are good ideas.
[eluser]Phil Sturgeon[/eluser]
Remap has a few flaws, you have to manually input any URL segments to the controller. For example: Code: <?php Wont work, $param will show as blank. Use routes for this sort of thing if you need variables from the URL.
[eluser]Michael Wales[/eluser]
Or just use the URI helper. I agree though, rerouting is a good way to go. Remapping is nice for little things. |
Welcome Guest, Not a member yet? Register Sign In |