繁体   English   中英

Laravel-导致封锁的路线

[英]Laravel - route leading to a closure

我不是MVC的新手,而是Laravel的新手。 我已经设法在Windows 8.1上使用WAMP安装了它。 我转到根URL( http://localhost/public/ )并获得Laravel徽标和“您已经到达”。 一行文字。

现在,我想尝试一下, 文档告诉我下面的代码应该可以工作。

<?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!';
});

导航到http://localhost/public/users users时应该获取文本users ,而不是404。我在做什么错?

您的路由文件中的代码应如下所示

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

试试看!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM