Static Route / predefined variables |
I am trying to setup a route that sets a fixed parameter
PHP Code: $routes->get('/', 'Pages::showme/first'); hitting "/" results in Code: Controller method is not found: showme\first But "/pages/showme/first" works as expected I have read the route manual but have not found a way to do it, any help is greatly appreciated
Route code
PHP Code: $routes->get('/', 'Pages::showme'); Controller method code PHP Code: public function showme($param = 'first') Default parameter value is ok, ![]()
Thanks for your reply! That works as expected with a small caveat
Code: /pages/showme/ is now accessible instead of throwing an error My controller looks something like this, ie. i don't want to have a default value PHP Code: public function showme($param = '') { |
Welcome Guest, Not a member yet? Register Sign In |