Using the remap with parameters |
10-20-2018, 03:21 PM
(This post was last modified: 10-20-2018, 03:30 PM by jreklund. Edit Reason: Added an example. )
Second are preferred as $params in _remap are an array. And if there are only one item in that array, it will convert it into a string.
With the first option you are going to get Array to String converting error. Also it will allow you to pass more then one param into that function e.g. index($arg, $arg2). First option gives you the entire array in $arg, and ignores $arg2. Here's an example I wrote to another forum member. If the first parameter matches a function it will call that, else it will pass it into index(). So http://localhost/create will go to create() and http://localhost/everything-else will go to index('everything-else'). PHP Code: <?php |
Messages In This Thread |
Using the remap with parameters - by Qodi - 10-20-2018, 02:11 PM
RE: Using the remap with parameters - by jreklund - 10-20-2018, 03:21 PM
RE: Using the remap with parameters - by Qodi - 10-21-2018, 07:35 AM
RE: Using the remap with parameters - by jreklund - 10-21-2018, 02:06 PM
|