宇宙无敌大大 2019-10-22 11:07 采纳率: 0%
浏览 881
已结题

laravel 5.8 blade模板里的 @extends 和@push 标签,编辑页面没有解析成功,但是列表页却能够正常解析,新手求大佬解答

create 页面

@extends('back.app')
@push('X-CSRF-TOKEN')
<meta name="csrf-token" content="{{ csrf_token() }}">
@endpush
@push('remodal_css')
<!-- remodal-->
<link rel="stylesheet" href="{{asset('/remodal/remodal-default-theme.css')}}">
<link rel="stylesheet" href="{{asset('/remodal/remodal.css')}}">
@endpush
@section('content')
<style>
    .skin-blue .sidebar-form input[type="text"], .skin-blue .sidebar-form .btn{
        background-color: #fff;
    }
</style>
<div class="row">
    <form action="{{route('menu.store')}}" method="post" class="form_single">
        @csrf
        <div class="box">
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.list_name')}}</label>
                            <input class="form-control" name="name" placeholder="{{trans('common.menu_name')}}" value="{{get_fit_val($data,'name')}}" type="text">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.sort')}}</label>
                            <input class="form-control" name="sort" placeholder="{{trans('common.sort')}}" value="{{get_fit_val($data,'sort')}}" type="text">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.route')}}</label>
                            <input class="form-control" name="route" placeholder="{{trans('common.menu_route')}}" value="{{get_fit_val($data,'route')}}" type="text">

                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.up_menu')}}</label>
                            <select name="pid" class="form-control">
                                <option value="0">{{trans('common.top_menu')}}</option>
                                @foreach ($data['sel_menu'] as $v)
                                <option value="{{$v['id']}}" @if (get_fit_val($data,'pid') == $v['id']) selected @endif>{!!$v['name']!!}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.icon')}}</label>
                            @include('back.layouts.icon')
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.is_show')}}</label>
                            <div style="height:34px;line-height: 34px;">
                                <label class="margin-r-5"><input type="radio" name="is_show" value="1" @if(get_fit_val($data,'is_show')==1 or get_fit_val($data,'status')=='') checked @endif> {{trans('common.yes')}}</label>
                                <label><input type="radio" name="is_show"  value="2" @if(get_fit_val($data,'is_show')==2) checked @endif> {{trans('common.no')}}</label>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label>{{trans('common.status')}}</label>
                            <div>
                                <label class="margin-r-5"><input type="radio" name="status" value="1" @if(get_fit_val($data,'status')==1 or get_fit_val($data,'status')=='') checked @endif> {{trans('common.enable')}}</label>
                                <label><input type="radio" name="status"  value="2" @if(get_fit_val($data,'status')==2) checked @endif> {{trans('common.forbidden')}}</label>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="box-footer">

                <input type="hidden" name="id" value="{{get_fit_val($data,'id')}}"/>

                <button  type="submit" class="btn btn-primary margin" data-style="slide-up" target-form="form_single">
                    <span class="ladda-label"><i class="fa fa-send"></i> {{trans('common.comfirm_space')}}</span>
                </button>

                <a class="btn btn-primary margin" href="{{go_back()}}"><i class="fa fa-history"></i> {{trans('common.back_space')}}</a>

            </div>
        </div>
    </form>
</div>
@endsection
@push('remodal_scripts')
<script src="{{asset('/remodal/remodal.min.js')}}"></script>
@endpush

继承的模板

<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>AdminLTE 2 | Starter</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        @stack('X-CSRF-TOKEN')
        <link rel="stylesheet" href="{{asset('/adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css')}}">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="{{asset('/adminlte/bower_components/font-awesome/css/font-awesome.min.css')}}">
        @stack('datepicker_css')
        @stack('datatable_css')
        @stack('remodal_css')
        <!-- Ionicons -->
        <link rel="stylesheet" href="{{asset('/adminlte/bower_components/Ionicons/css/ionicons.min.css')}}">
        <!-- Theme style -->
        <link rel="stylesheet" href="{{asset('/adminlte/dist/css/AdminLTE.min.css')}}">
        <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
              page. However, you can choose any other skin. Make sure you
              apply the skin class to the body tag so the changes take effect. -->
        <link rel="stylesheet" href="{{asset('/adminlte/dist/css/skins/skin-blue.min.css')}}">

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

        <!-- Google Font -->
        <link rel="stylesheet"
              href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
        <!-- jQuery 3 -->
        <script src="{{asset('/adminlte/bower_components/jquery/dist/jquery.min.js')}}"></script>
        <!-- Bootstrap 3.3.7 -->
        <script src="{{asset('/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js')}}"></script>
        <!-- AdminLTE App -->
        <script src="{{asset('/adminlte/dist/js/adminlte.min.js')}}"></script>
    </head>
    <!--
    BODY TAG OPTIONS:
    =================
    Apply one or more of the following classes to get the
    desired effect
    |---------------------------------------------------------|
    | SKINS         | skin-blue                               |
    |               | skin-black                              |
    |               | skin-purple                             |
    |               | skin-yellow                             |
    |               | skin-red                                |
    |               | skin-green                              |
    |---------------------------------------------------------|
    |LAYOUT OPTIONS | fixed                                   |
    |               | layout-boxed                            |
    |               | layout-top-nav                          |
    |               | sidebar-collapse                        |
    |               | sidebar-mini                            |
    |---------------------------------------------------------|
    -->
    <body class="hold-transition skin-blue sidebar-mini">
        <div class="wrapper">


            @include('back.layouts.header')

            @include('back.layouts.sidebar')

            <!-- Content Wrapper. Contains page content -->
            <div class="content-wrapper">

                <!-- Content Header (Page header) -->
                <section class="content-header">
                    @include('back.layouts.tip')
                    <h1>
                        Page Header
                        <small>Optional description</small>
                    </h1>
                    <!--                    <ol class="breadcrumb">
                                            <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
                                            <li class="active">Here</li>
                                        </ol>-->
                </section>

                <!-- Main content -->
                <section class="content container-fluid">

                    @yield('content')

                </section>
                <!-- /.content -->
            </div>
            <!-- /.content-wrapper -->


            @include('back.layouts.footer')

            <!-- Control Sidebar -->
            <aside class="control-sidebar control-sidebar-dark">
                <!-- Create the tabs -->
                <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
                    <li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
                    <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <!-- Home tab content -->
                    <div class="tab-pane active" id="control-sidebar-home-tab">
                        <h3 class="control-sidebar-heading">Recent Activity</h3>
                        <ul class="control-sidebar-menu">
                            <li>
                                <a href="javascript:;">
                                    <i class="menu-icon fa fa-birthday-cake bg-red"></i>

                                    <div class="menu-info">
                                        <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                                        <p>Will be 23 on April 24th</p>
                                    </div>
                                </a>
                            </li>
                        </ul>
                        <!-- /.control-sidebar-menu -->

                        <h3 class="control-sidebar-heading">Tasks Progress</h3>
                        <ul class="control-sidebar-menu">
                            <li>
                                <a href="javascript:;">
                                    <h4 class="control-sidebar-subheading">
                                        Custom Template Design
                                        <span class="pull-right-container">
                                            <span class="label label-danger pull-right">70%</span>
                                        </span>
                                    </h4>

                                    <div class="progress progress-xxs">
                                        <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                        <!-- /.control-sidebar-menu -->

                    </div>
                    <!-- /.tab-pane -->
                    <!-- Stats tab content -->
                    <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
                    <!-- /.tab-pane -->
                    <!-- Settings tab content -->
                    <div class="tab-pane" id="control-sidebar-settings-tab">
                        <form method="post">
                            <h3 class="control-sidebar-heading">General Settings</h3>

                            <div class="form-group">
                                <label class="control-sidebar-subheading">
                                    Report panel usage
                                    <input type="checkbox" class="pull-right" checked>
                                </label>

                                <p>
                                    Some information about this general settings option
                                </p>
                            </div>
                            <!-- /.form-group -->
                        </form>
                    </div>
                    <!-- /.tab-pane -->
                </div>
            </aside>
            <!-- /.control-sidebar -->
            <!-- Add the sidebar's background. This div must be placed
            immediately after the control sidebar -->
            <div class="control-sidebar-bg"></div>
        </div>
        <!-- ./wrapper -->

        <!-- REQUIRED JS SCRIPTS -->



        @stack('datepicker_scripts')        

        @stack('datatable_scripts') 

        @stack('remodal_scripts') 
        <script src="{{asset('/admin/js/common.js')}}"></script>
        <!-- Optionally, you can add Slimscroll and FastClick plugins.
             Both of these plugins are recommended to enhance the
             user experience. -->
    </body>
</html>

create 页面效果

list 页面效果
图片说明

  • 写回答

2条回答 默认 最新

  • 神級描述師 2019-10-22 11:41
    关注

    试试将create 页面的html标签加上呢

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向