drurhg37071 2015-07-27 10:05
浏览 77
已采纳

Laravel 5视图结构

I added a bootstrap template to laravel 5 Resources directory. And added only the index.php to views in Resources.

The index.php file is pointing the files like :

<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

And its not loading.

In my routes.php i am loading :

Route::get('/', function () {
  return view('index');
});
  • 写回答

2条回答 默认 最新

  • duanbei1903 2015-07-27 10:25
    关注

    As I can see in the code, ViewFinder does a case sensitive search for a template based on whatever you provide to the view() helper.

    Pass Index to view() instead of index or change the template name from Index.php to index.php.

    If your view renders correctly, but CSS file is not loaded, it means it's inaccessible to the browser. Files that are not returned via Laravel need to end up somewhere in /public folder so that web server can read them and return to the browser. You need to place them there manually or using some build toos (gulp, grunt, ...).

    In your case, your bootstrap file must end up in public/bootstrap/css/ folder.

    You could also fetch the bootstrap file from a CDN by using one of absolute URLs you can find here: http://www.bootstrapcdn.com/, e.g.:

    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?