Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 当使用@include()时,{{}}不在部分文件内工作_Php_Laravel_Include - Fatal编程技术网

Php 当使用@include()时,{{}}不在部分文件内工作

Php 当使用@include()时,{{}}不在部分文件内工作,php,laravel,include,Php,Laravel,Include,overview.blade.php @extend('common') @section('content') ..some html code @endsection ..some html code @include('includes.nav') @yield('content') ..some html code common.blade.php @extend('common') @section('content') ..some html code @en

overview.blade.php

@extend('common')
@section('content')
..some html code     
@endsection
..some html code
@include('includes.nav')
@yield('content')
..some html code
common.blade.php

@extend('common')
@section('content')
..some html code     
@endsection
..some html code
@include('includes.nav')
@yield('content')
..some html code
include/nav.php

<a href="{{ route('inventory') }} ">Inventory</a>

上面的代码在浏览器中打印出{route('inventory')},而不是值

当我在overview.blade.php上试用它时,效果很好


非常感谢你的帮助。谢谢

重命名
include/nav.php
include/nav.blade.php
,因为您希望Laravel刀片引擎编译此文件

发件人:

刀片视图文件使用
.Blade.php
文件扩展名,通常存储在
resources/views
目录中