Controller with index($id) method with parameter |
i add a route for a "get request like"
Code: $routes->get('(:any)', 'Pages::showme/$1'); where $something represents a changing end bit of url but on the right , it doesn't look as if your referencing any class or method you could directly call method index method on a class if its define but your route should be something like mine. Quickest way to play would probably be to edit home controller and add a method Try this Code: below : $routes->get('/', 'Home::index'); Find the controller Home.php in app/Controllers and edit add appropriately between class { and } : Code: public function test($something) then on your url http://yourapp/vegetables and see if "vegetables gets returned |
Messages In This Thread |
Controller with index($id) method with parameter - by Corsari - 08-25-2021, 05:42 AM
RE: Controller with index($id) method with parameter - by captain-sensible - 08-25-2021, 06:56 AM
RE: Controller with index($id) method with parameter - by plaztic - 08-25-2021, 10:52 AM
RE: Controller with index($id) method with parameter - by Corsari - 08-25-2021, 01:06 PM
RE: Controller with index($id) method with parameter - by captain-sensible - 08-26-2021, 01:45 AM
|