2
我問過,我這樣定義的路線:Laravel 5.2 XAMPP找不到對象
Route::get('error/{name}',function($name){
return $name;
});
我可以成功訪問其他路線。只有這一個返回Object not found
。我試圖解決這個問題的日子。今天,我發現在XAMPP配置文件/xampp/apache/conf/extra/httpd-multilang-errordoc.conf
這些代碼:
Alias /error/ "E:/xampp/apache/error/"
<Directory "E:/xampp/apache/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Require all granted
LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
如果我刪除這些代碼,我的路線的作品。所以我有一個問題,我應該定義我的路線不在error
或給上述代碼別名而不是error
?
你的路線不正確,試圖把$ name放在函數中($ name) –
我剛剛創建了它並且適用於我 –
對不起,我只是在代碼中錯過了它。但是我原來的代碼有'$ name' – DengDeng