Router::connect method is used to connect routes .
first, you have to enter into :
cake_php_project_folder/config/routes/folder(on the name of Controller)/file.php(on the name of function_name_of_the controller)
and then
add then call a method named connect().
syntax:
$routes->connect('/page_name',['controller'=>'controller_name','action'=>'function_name']);
there are three arguments in the Router::connect method:
- the URL template you wish to match
 - default values for your route elements
 - options for the route which generally contains regular expression rules.
 
0 Comments