您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
webman-路由-类路由
发布时间:2022-01-18 22:22:58编辑:雪饮阅读()
类路由在config/route.php中配置如
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Route;
Route::any('/testclass', [app\controller\Foo::class, 'index']);
此时访问路径/testclass将导航至app\controller\Foo::class类的index方法中
访问实例:
[root@localhost wwwroot]# elinks http://192.168.31.53:8787/testclass --dump
hello index
关键字词:webman,路由,类路由