867   Laravel

安装laravel请参照之前的文章

1,laravel5欢迎页地址:http://localhost.laravel5/server.php,或者http://localhost.laravel5/public/index.php,

localhost.laravel5是我本地域名,指向laravel5的根目录的public,默认读取index.php,所以欢迎页最终地址:http://localhost.laravel5/

 

QQ图片20150912163329

 

 

 

2,查看欢迎页的路由,视图在resource/views下的welcome.blade.php,路由在app/Http/routes.php,内容如下:

Route::get(‘/’, ‘WelcomeController@index’); //这个就是欢迎页的路由, 指向控制器WelcomeController的index方法

Route::get(‘home’, ‘HomeController@index’);

Route::controllers([
‘auth’ => ‘Auth\AuthController’,
‘password’ => ‘Auth\PasswordController’,
]);

 

3,访问另外一个路由地址:http://localhost.laravel5/index.php/home,请注意,这里的index.php,假如你的apache没有开启mod_rewrite,必须加上,开启了并在public下配置了.htaccess,地址改为:http://localhost.laravel5/home,访问后会自动跳到http://localhost.laravel5/auth/login

QQ图片20150912164602

 

 

参考链接:

http://lvwenhan.com/laravel/432.html

 

 




Leave a Reply

Your email address will not be published. Required fields are marked *