微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在此刀片文件顶部放置编码?

如何解决如何在此刀片文件顶部放置编码?

我在刀片文件中使用@stack 和@push。但它不起作用,因为@stack 在布局刀片中工作,在截面刀片中不起作用

@stack('test-section')

this is test section

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

我只是想让一个部分有认数据,例如

@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 在此刀片顶部声明 $top 时没问题。我的想法来自 shopify 的液体 {% schema %}

是的,没有必要,section数据需要在section top中声明,如果我在section top中声明,代码将变得糟糕

@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

这是我在堆栈溢出中的第一个问题,我需要帮助。谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。