比如Controller有个函数是
public function test($var) {
//some code...
}
怎样在routes.php定义get/abc时调用Controller的test('abc')?
不用泛变量如Route::get(/{var}', function($var)...这样的形式,因为$var的值是固定的几个。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
Request对象也可以获取。