Route.php 573 字节
<?php

namespace Lib;

use Controller\Home;

/**
 * 路由
 * @author:dc
 * @time 2023/2/13 11:22
 * Class Route
 * @package Lib
 */
class Route {

    /**
     * @var array
     */
    private array $url = [];

    public function __construct()
    {

        $this->url = [
            'login' =>  [Home::class,'login']
        ];

    }

    /**
     * @param $route
     * @return array
     * @author:dc
     * @time 2023/2/13 11:30
     */
    public function get($route):array{
        $route = trim($route,'/');
        return $this->url[$route]??[];
    }



}