【发布时间】:2015-02-18 07:30:23
【问题描述】:
我在使用 laravel 时遇到了一个非常奇怪的错误
Route::get('/', function()
{
return View::make('index');
});
它会正确加载视图内的 index.php
但是
当我有类似http://localhost:8000/xyz(不存在)的东西时,它也会路由到 index.php 并且所有 js 文件都会正确加载,但是当我转到 http://localhost:8000/xyz/abc(不存在)时
它没有正确加载 js 文件,我的页面呈现错误
App::missing(function($exception)
{
return View::make('index');
});
我的应用缺少功能。
为什么会这样。
除此之外,我还有另一个 laravel 实例,它没有给出这样的问题,它也可以处理
http://localhost:8000/xyz/abc/ahbfd/dfdfd/dfdfd
(不存在)
没有任何错误。
希望我很清楚。
【问题讨论】:
-
您尝试在
/start/global.php中使用App::error吗? -
应用程序错误已经存在
App::error(function(Exception $exception, $code) { Log::error($exception); });
标签: php laravel laravel-4 laravel-routing