Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to put coding in this blade file top? #56

Open
790676323 opened this issue Feb 12, 2021 · 0 comments
Open

how to put coding in this blade file top? #56

790676323 opened this issue Feb 12, 2021 · 0 comments

Comments

@790676323
Copy link

790676323 commented Feb 12, 2021

i use @stack and @Push in my blade file.but it not works,because @stack works in layout blade,it not works in a section blade

@stack('test-section')

this is test section

@push('test-section')
    this is test put
@endpush

i just want to make a section have default data,for example

@extends('body')
@section('content')
@stack('test-section')

this is test section{{$top}}

@endsection

@push('test-section')
    this is test put
    @php
        $top = $top??'this top';
    @endphp
@endpush

$top is ok when $top declared in this blade top.my idea from shopify's liquid {% schema %}

it's not necessary ,the section data need declared in the section top,if i declared in the section top,code will become poorly managed

@extends('body')
@section('content')
    @php
        $top = $top??'this top';
        $top1 = $top??'this top';
        $top2 = $top??'this top';
        $top3 = $top??'this top';
        $top3 = $top??'this top';
        $top4 = $top??'this top';
        $top5 = $top??'this top';
        $top6 = $top??'this top';
        $top7 = $top??'this top';
        ...
    @endphp

    this is test section{{$top}}

@endsection

I need help.Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant