2017-01-21 4 views
1

これは非常に基本的で愚かな質問ですが、私は最後の2日間から試していますが、私のミスはどこでも検索しています。私は、ブレード構文を使用しているチュートリアルからlaravelと学習の初心者です。Laravel Blade構文@yeild( 'content')が動作しない

Web.php

Route::get('about','[email protected]'); 

makeController.php

class makeController extends Controller 
{ 
public function FunFun(){ 
    $first = 'Muhammad'; 
    $last = 'Uzair Warsi'; 
    return view('pages.app',compact('first')); 
}} 

app.blade.php

@extends('pages.funview') 

@section('content') 

<h1>my name is : {{$first}}</h1> 

@stop 

funview.blade.php

<!DOCTYPE html> 
<head> 
</head> 
<html> 
<title>HTML Tutorial</title> 
<body> 

<h1>this is from funview page</h1> 

    @yeild('content') 


</body> 
</html> 

問題はlocalhostがすべてのものタイトルの見出しをロードし、またブレード部分の内容ではなく@yeild( 'content')を出力することです。

+0

はあなたのポストに間違ってラベル付けなかったか、あなたのapp.bladeが含まれていませんビューとfunviewにはテンプレートが含まれていますか?それは後ろ向きです。 –

答えて

6

構文は次のとおりです。ブレードと構文チェックの詳細については

@yield('content') 

ない@yeild

https://laravel.com/docs/5.3/blade#template-inheritance

+0

私はこのばかげた綴り間違いをしているとは思わない。 btw thankyou so much – Uzair

+0

あなたのIDEにブレード構文のプラグインがあるかどうかを確認してください。 – Robert

+0

今は崇高で崇高な私はブレード構文を見つけていないので、phpstormに移動しています。 – Uzair

関連する問題