Php 当使用@include()时,{{}}不在部分文件内工作
overview.blade.phpPhp 当使用@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
@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
目录中