2017-10-09 108 views
0

我已经安装Laravel刀片荧光笔仅仅是纯白色的文字(“内容”)..@yield上laravel不工作

@yield @section @endsection不工作,只是一个普通的白色文字..

我的看法是否正常工作。我可以在浏览器他们没关系..

这里是我的代码:

web.php:

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

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 
+0

而app.blade.php是在布局目录中,对不对? – Amarnasan

+1

您需要将'index.php'更改为'index.blade.php',然后您需要将'storage'权限更改为php可以在那里写入。 –

+0

是的,它的作品谢谢!我应该关闭所有关于崇高文本的标签,以便我可以看到更改。 –

回答

0

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

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