Php Laravel-通往关闭的路线
我对MVC并不陌生,但对拉雷维尔来说是个新手。我已经设法用WAMP在Windows 8.1上安装了它。我转到根URL(Php Laravel-通往关闭的路线,php,laravel,routing,Php,Laravel,Routing,我对MVC并不陌生,但对拉雷维尔来说是个新手。我已经设法用WAMP在Windows 8.1上安装了它。我转到根URL(http://localhost/public/)并获取Laravel徽标和“You have arrival.”行文本 现在我想玩一玩,告诉我下面的代码应该可以工作 <?php /* |-------------------------------------------------------------------------- | Application Rout
http://localhost/public/
)并获取Laravel徽标和“You have arrival.”行文本
现在我想玩一玩,告诉我下面的代码应该可以工作
<?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!';
});
路由文件中的代码应该如下所示
Route::get('/users', function () {
return 'users!';
});
试试看 你的密码没问题为什么我要404?在我进行更改后是否需要重新运行某些内容?您是否按照设置了web服务器?您是否尝试使用/users
而不是users
?我不确定为什么它对您不起作用,但我只是将您的代码复制到本地安装,并按预期工作,奇怪的是,文档中没有提到预斜杠。谢谢