我已經定義的路線是這樣的:如何在路由參數中發送URL?
$app->map(['GET', 'POST'],'/abc/[{url}]', function ($request, $response, $args) {
return $response;
})->add(new CustomMiddleware());
其工作正常,當我通過一個URL,而不http://
但給了我一個404 page not found
-page與http://
或https://
。我也嘗試使用url編碼的字符串,但給出相同的錯誤:
http://localhost/slim/public/index.php/abc/http%3A%2F%2Fstackoverflow.com
The requested URL /slim/public/index.php/abc/http://stackoverflow.com was not found on this server.
我正在使用Slim版本3.1。
當我的回答可以幫到你,請把它標記爲正確的。 – jmattheis
@jmattheis你的回答很好,但沒有達到我的問題。請通過這個問題,我想如何傳遞參數.. ??我已經意識到你的建議,但我想按照我的方式來做..反正感謝您的幫助。 – Ritesh
是的,看看我的答案,爲什麼不能用未編碼的''/''來傳遞它,那麼編碼''/''怎麼可能呢?我現在不知道你想要什麼。 – jmattheis