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 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)