Using routes.php with Phil Sturgeon's REST_Controller |
[eluser]DJMOHNL[/eluser]
as i read it i think that you mean: you want the: domain.com/api/function to be used as: domain.com/api/A_Variable_here/Another_Variable_Here what the _remap function will do is convert: www.yourdomain.com/controller/index/variable (index can be function name if there is one that matches the in url) to www.yourdomain.com/controller/variable (it sents the 'variable' to the index function of the controller if there is no 'function' name equal variable name.) Code: // it sends the domain.com/[1st_segment]/[2nd_segment]/[3rd_segment] - remember to paste this code as the last function in your controller, as it is the last action to be handled if needed only. Then use your controller functions as: Code: // This is the index() function inside your controller you can set them to null, blank '' or a default value. You must remember, always set a null at least! you cant use index($variable,$variable2) this would give some errors on some request types. Hope it helps. |
Messages In This Thread |
Using routes.php with Phil Sturgeon's REST_Controller - by El Forum - 06-30-2010, 01:46 PM
Using routes.php with Phil Sturgeon's REST_Controller - by El Forum - 07-22-2010, 11:37 PM
|