繁体   English   中英

Laravel不会使用刀片

[英]Laravel won't use blades

我正在尝试在laravel中创建刀片配置文件。 我在“ xampp \\ htdocs \\ laravel5-learning \\ resources \\ views \\ layouts”中创建了“ master.blade.php”,其中包含:

<!DOCTYPE html>
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
<div class="container">
@yield('content')
</div>
</body>
</html>

然后我在“ xampp \\ htdocs \\ laravel5-learning \\ resources \\ views”方向上有一个文件“ welcome.blade.php”。 它包含:

@extends('layouts.master')

@section('title')
Welcome!
@endsection

@section('content')
This is the content!
@endsection

但是,这将不起作用。 我还有一个测试php文件,在运行localhost \\ laravel5-learning \\ resources \\ views \\ test.php时可以正常工作

我得到了Apache和使用xampp运行的sql服务器。

有人有主意吗? 我觉得我缺少使用Laravel的重要步骤。 我安装了xampp,然后在htdocs文件夹中的行中使用composer安装了Laravel:composer create-project laravel / laravel laravel5-learning

如果我转到http://localhost/laravel5-learning/resources/views/welcome.blade.php ,实际代码将显示:@extends('layouts.master')@section('title')欢迎! @endsection @section('content')这就是内容! @endsection

有人有主意吗?

找到了解决方案。 我正在运行实际的代码,但是我应该在公共文件夹中运行index.html文件。

我猜我是个很大的菜鸟错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM