自定義路線不正確,總是路線工作user.htm自定義路由工作不正常[F3]
的index.php
$routes = [
"/" => "index.htm",
"/user/[email protected]" => "user.htm","/user/@id" => "user.htm",
];
foreach ($routes as $path => $file) {
$f3->route("GET ".$path,
function($f3){
global $file,$path;
echo View::instance()->render($file);
}
);
}
工作,謝謝。但是,請您詳細說明爲什麼這種方法有效,而且我使用的方法不適用?再次感謝:D –