Laravel - 通往关闭的路线

时间:2014-10-09 12:06:19

标签: php laravel routing

我不是MVC的新手,但我是Laravel的新手。我已经设法在带有WAMP的Windows 8.1上安装它。我转到根网址(http://localhost/public/)并获取Laravel徽标,并且“你已经到达了。”#39;文本行。

现在我想玩一下,the documentation告诉我下面的代码应该有效。

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
    return View::make('hello');
});

Route::get('users', function () {
    return 'users!';
});

当我导航到users而不是404时,我应该收到文字http://localhost/public/users。我做错了什么?

1 个答案:

答案 0 :(得分:1)

路由文件中的代码应该是这样的

Route::get('/users', function () {
    return 'users!';
});

试一试!