我正在尝试学习laravel。我面临观点的问题。当我运行以下代码时:
Route::get('/', function(){
return 'welcome';
});
它工作正常。但是当我尝试使用视图时
Route::get('/', function(){
return view('welcome');
});
除了空白页,我什么也没有。(resource / views目录中存在一个welcome.balde.php页面)
在路由过程中我也遇到问题。这样的代码
Route::get('home', 'HomeController@index');
我无法访问localhost / laravel / public / home目录,这给我一个错误,找不到目录或文件。代替此localhost / laravel / public / index.php / home url的作品。不知道是什么问题。我正在使用php 5.4和mysql 5.5
我正在使用linux OS,这就是为什么权限有问题。给我的项目文件夹适当的权限(apache服务器)后,视图问题已修复。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句