我的代码出了点小问题。我最近开始使用laravel很长时间了,他们对语法做了一些修改,所以我认为这不是问题所在。我想我在编写基本html时犯了错误。
我的@include显示为文本,甚至当我注释掉这一行时--整件事也是以文本的形式出现。
(我正在使用notepad++)
page.php
@extends('layouts.layout')layout.php
<!DOCTYPE html>
<html lang="en">
<head>
//@include('includes.head')
<link href="{{ asset('/css/style.css') }}" rel="stylesheet">
<style>
body
{
background-color: #B0BEC5;
}
</style>
</head>
<body>
<footer>
</footer>
</body>
</html>结果:

我还将样式直接添加到头部进行测试,因为出于某种原因,它也没有读取我的style.css文件。
style.css
html,body
{
height: 100%;
background-color:red;
}
footer {
height: 50px;
background-color: black;
}发布于 2015-06-10 07:14:23
如果你想评论的话。当你已经在里面的时候,你应该遵循一种说唱的方式。
{{-- This comment will not be present in the rendered HTML --}}但是,如果要将文件名作为布局或扩展,则应该具有扩展名.blade.php。否则,您的{{标记将无法获得效果,因此您的.css或.js文件也不会加载,这将导致简单的html作为输出。
参考这里,以了解更多关于叶片模板在Laravel。
https://stackoverflow.com/questions/30749485
复制相似问题