PHP controller

 

①XAMPP Apache启动

PHP controller

 

②编写HelloController.php

PHP controller

 

<?php
namespace App\Controller;

use App\Controller\AppController;

class HelloController extends AppController{
    public $autoRender = false;
    
    public function index(){
        echo "<html><body><h1>Hello!</h1>";
        echo "<p>This is sample page!</p></body></html>

}

?>

 

PHP controller

http://localhost/mycakeapp/hello

PHP controller