0
私は以下のコードを持っていました。サブビューで異なるレイアウトを拡張できますか?
@if(isset($is_gift_card_site) && $is_gift_card_site)
@extends('gift_card.layout.index')
@else
@extends('layout.index2')
@endif
@section('content')
//html
@stop
これは機能します。しかし、それは両方のレイアウト(複製)を拡張します。この問題の解決策。どうもありがとう。
もう一度確認してください。それは動作しません。それは重複しませんが、常に 'gift_card.layout.index'を拡張します。 –
これを試してください: '<?php $ layout = isset($ is_gift_card_site)&& $ is_gift_card_site? 'gift_card.layout.index': 'layout.index2'; ?> ' ' @extends($ layout) ' – TheFallen