簡體   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