'controller'
,
'action'
,
'plugin'
. Additionally, you can provide routed elements or query string
parameters. If string, it can be given the name of any valid url string.
If true, the full base URL will be prepended to the result. Default is false.
Example
Make Changes in the
config/routes.php
file as shown in the following program.
config/routes.php
use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
Router::defaultRouteClass('DashedRoute');
Router::scope('/', function (RouteBuilder $routes) {
$routes-
>connect('/generate',['controller'=>'Generates','action'=>'index']);
});
Plugin::routes();
Create a
GeneratesController.php
file at
src/Controller/GeneratesController.php
.
Copy the following code in the controller file.
Do'stlaringiz bilan baham: |