I am making small project in cakePHP v3.5, i am not able to use parametrized in appropriate way. Also in some cases if we want to pass optional parameter in url then how can i do?
CakePHP v3.5
$routes->get('test/testfn/:param1/:param2', ['controller' => 'Pages', 'action' => 'testfn']);
where
test: Controller,
testfn: Method of TestController,
param1: Parameter 1,
param2: Parameter 2
All i did to get params from url to TestController,
$this->request->getParam(param1)
$this->request->getParam(param2)
How can i list all parameters that i passed from routes to My Controller instead of single param step by step.
OR anyone have better options to do routing in cakePHP v3.5
Also I am confused about the paramterized routing principle of cakePHP3.4 so, in that case if anyone has some solution to cakePHP v3.4.
Please Help me.
Thanks