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('/', ['controller' => 'Tests', 'action' => 'index']);
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' =>
'display']);
$routes->fallbacks('DashedRoute');
});
Plugin::routes();
Create a
TestsController.php
file at
src/Controller/TestsController.php
. Copy the
following code in the controller file.
src/Controller/TestsController.php
namespace App\Controller;
use App\Controller\AppController;
class TestsController extends AppController{
CakePHP
13
public function index(){
}
}
?>
Create a folder
Do'stlaringiz bilan baham: |