laravel上的@yield('内容')不仅仅是纯白色文本

时间:2017-10-09 07:28:42

标签: laravel sublimetext3 blade highlight yield

我已经安装了Laravel Blade Highlighter ..

@yield @section @endsection不起作用,只是一个纯白色文字..

我的观点运作正常..我可以浏览它们好了..

这是我的代码:

web.php:

    Route::get('/', 'PagesController@index');
Route::get('/about', 'PagesController@about');
Route::get('/services', 'PagesController@services');

pagesController.php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PagesController extends Controller
{
    public function index(){
        return view('pages.index');;
    }

    public function about(){
        return view('pages.about');
    }

    public function services(){
        return view('pages.services');
    }

}

app.blade.php

<h1>This is the laravel</h1>
@yield('content')

的index.php:

@extends('layouts.app')

@section('content')
    <h1>Welcome to Laravel</h1>
    <p>this is a content</p>
@endsection

1 个答案:

答案 0 :(得分:0)

答案是我应该关闭我崇高文字上的所有打开标签..

index.php,about.php和services.php应该是index.blade.php,about.blade.php和services.blade.php