路由类 Router.php<?php
class Router
{
private $routes = [];
private $routeCount = 0;
public function addRoute($method, $url, $callback)
{
if ($url !== '/') {//去除 url 尾部斜杠
while ($url !== $url = rtrim($url, '/'));//不应该去除 url 尾部斜杠,以后要改
}
$this->route……