1
是否有一種方法可以在父視圖中聲明的子視圖中生成子節視圖?Laravel在父子視圖中生成父子節
如果我在主視圖中產生('custom_code')視圖它的工作。
我做錯了什麼?
母版視圖
<html>
@include('client.acccount')
<h1>In Master</h1>
@yield('bookInfo')
</html>
子視圖
@extends('layouts.Master')
/*
I also tried that
@section('custom_code')
@parent
@endsection
*/
@section('bookInfo')
<h1>In Child View</h1>
@yield('custom_code')
@endsection
client.acccount文件
@include('load_db_code')
load_db_code文件
<?php
$agent = Agent::find(Auth::id());
$lang = Cache::get("lang");
$temp = "";
if (Session::has('demo'))
{
$temp = "temp_";
}
?>
@if($lang == 'fr')
@if($agent->apparenceb2c->{$temp.'header_fr'} != "")
@section('custom_code')
{{ $agent->apparenceb2c->{$temp.'header_fr'} }}
@endsection
@endif
@endif
我得到這個錯誤:查看[custom_code]未找到。 custom_code不是視圖 – user2942945
custom_code的內容是什麼? –
從正確的客戶端加載的html/css db – user2942945