dqrmkdu25623 2016-09-10 19:43
浏览 211

Laravel印刷@section

I have a problem with: 'Cannot end a section without first starting one.'

when I comment this:

throw new InvalidArgumentException('Cannot end a section without first starting one.');

on factory.php

I get that the view is actually printing @section('scripts')@parent

The code is kind of long, I will delete html that I think its not part of the problem, I left the section script complete because its the one that gets printed for some reason.

@extends('layouts.admin')


@if(!Auth::user()->hasRole('admin'))

    @section('body_class', 'pace-done boxed-layout')

@endif



@section('title', 'Poolin')


@section('head')

    @parent
        ....

@stop



@section('content')


<div class="row wrapper border-bottom white-bg page-heading">
    ....
</div>


@stop


@section('scripts')


    @parent


        <!-- Chosen -->

<script src="{{ asset('inspinia_admin_theme/js/plugins/chosen/chosen.jquery.js') }}"></script>

<script src="{{ asset('inspinia_admin_theme/js/plugins/select2/select2.full.min.js') }}"></script>
    <script src="{{ asset('inspinia_admin_theme/js/plugins/datapicker/bootstrap-datepicker.js') }}"></script>

    <!-- Image cropper -->

    <script src="{{ asset('inspinia_admin_theme/js/plugins/cropper/cropper.min.js') }}"></script>

    <script src="{{ asset('js/data-tables/jquery.dataTables.js') }}"></script>
    <script src="{{ asset('js/data-tables/DT_bootstrap.js') }}"></script>
    <script src="{{ asset('js/sweetalert.js') }}"></script>



    <script type="text/javascript">
        $('#start_date').datepicker({

            todayBtn: "linked",

            keyboardNavigation: false,

            forceParse: false,

            calendarWeeks: true,

            autoclose: true,

            startDate: new Date(),
            dateFormat: 'dd-mm-yy'

        });
        $('#end_date').datepicker({

            todayBtn: "linked",

            keyboardNavigation: false,

            forceParse: false,

            calendarWeeks: true,

            autoclose: true,

            startDate: new Date(),
            dateFormat: 'dd-mm-yy'

        });
        function saveLanguage(){

            var url='/profile/saveLanguages';
            var data=$("#languageForm").serialize();
            if($('#language').val()=='0'){
                swal('','Selecciones un idioma','warning');
            }
            else {

                $.post(url, data, function (r) {

                    if (r.status == 400) {
                        alert('ya registro este lenguaje');
                    }
                    addRowLanguages(r.name, r.data.write_level, r.data.read_level, r.data.speak_level, r.language);
                });
            }
        }

        function getLanguages(){

            $.get('/profile/getLanguages/'+$("#client_id").val(),function(response){

                $(response.data).each(function(key,value){

                    addRowLanguages(value.name,value.pivot.write_level,value.pivot.read_level,value.pivot.speak_level,value.id);
                });
            });
        }
        function addRowLanguages(i,ne,nl,np,id){


            var   fila = '<tr><td>'+i+'</td><td>'+ne+'</td><td>'+nl+'</td><td>'+np+'</td><td><button   type="button" class="brn btn-danger btn-sm"  id="'+id+'" onclick="deleteRowLanguage(this.id)"><i class="fa fa-delete"></i>Borrar</button></td></tr>';

            $('#fieldsLanguages').append(fila);
            $('#languages-table').show(300);
        }

        function saveCertificates(){

            var url='/profile/saveCertificates';
            var data=$("#certificateForm").serialize();


            $.post(url,data,function(r){


                addRowCertification(r.data.name,r.data.institution,r.data.status,r.data.start_date,r.data.end_date,r.data.id);
            });
        }
        function guardar(n){
            var url='/profile/storeWork';

            $.ajax({

                method:"POST",
                url:url,
                data:{company:$("#company").val(),function:$("#function").val(),year_start:$("#year_start").val(),month_start:$("#month_start").val(),year_end:$("#year_end").val(),month_end:$("#month_end").val(),description:$("#description").val(),client_id:$("#client_id").val()},

                async: false,
                success:function (response){

                    if(response.status==200)

                        add(response.data.company,response.data.month_start,response.data.year_start,response.data.year_end,response.data.month_end,response.data.function,response.data.description,response.data.id);

                }


            });




        }
        function add(c,ms,ys,ye,me,f,d,id){

            var   fila = '<tr><td>'+c+'</td><td>'+f+'</td><td>'+ms+'-'+ys+'</td><td>'+me+'-'+ye+'</td><td>'+d+'</td><td><button   type="button" class="brn btn-danger btn-sm"  id="'+id+'" onclick="deleteRow(this.id)"><i class="fa fa-delete"></i>Borrar</button></td></tr>';

            $('#fieldsWork').append(fila);
            $('#table-works').show(300);

        }
        function deleteRow(id){




            var f=$("#"+id).parent().parent();

            $.get('/profile/deleteWork/'+id,function(response){

                if(response.status==200){

                    f.remove();
                }
                else{

                    alert('error');
                }
            });
        }
        function deleteRowCertificate(id){


            var f=$("#"+id).parent().parent();

            $.get('/profile/deleteCertificate/'+id,function(response){

                if(response.status==200){

                    f.remove();
                }
                else{

                    alert('error');
                }
            });
        }


        function deleteRowLanguage(id){


            var f=$("#"+id).parent().parent();

            $.get('/profile/deleteLanguage/'+id,function(response){

                if(response.status==200){

                    f.remove();
                }
                else{

                    alert('error');
                }
            });
        }
        function getWorks(){


            $.get('/profile/getWorks/'+$("#client_id").val(),function(response){

                if(response.status==200) {
                    $(response.data).each(function(key,value){


                        add(value.company,value.month_start,value.year_start,value.year_end,value.month_end,value.function,value.description,value.id);
                    });
                }

            });

        }


        function addRowCertification(t,i,s,sd,ed,id){


            var   fila = '<tr><td>'+t+'</td><td>'+i+'</td><td>'+s+'</td><td>'+sd+'-'+ed+'</td><td><button   type="button" class="brn btn-danger btn-sm"  id="'+id+'" onclick="deleteRowCertificate(this.id)"><i class="fa fa-delete"></i>Borrar</button></td></tr>';

            $('#fieldsCertification').append(fila);
            $('#certification-table').show(300);
        }

        function getCertications(){


            $.get('/profile/getCertifications/'+$("#client_id").val(),function(response){

                if(response.status==200) {
                    $(response.data).each(function(key,value){

                        addRowCertification(value.name,value.institution,value.status,value.start_date,value.end_date,value.id);
//                        $("#certification-table").reset();
                    });
                }

            });

        }
        function addRowSkill(name,id,jid){
            var fila=' <li class="label label-info ladda-button "><h5> '+name+' <a href="###" id="s'+id+'" onclick="deleteSkill(this.id,'+jid+','+id+')">X</a></h5></li> ';
            $('#listaSkill').append(fila);

        }

        function deleteSkill(sid,jid,id){



            var f=$("#"+sid).parent().parent();

            $.get('/profile/deleteSkill/'+id+'/'+jid,function(response){

                if(response.status==200){

                    f.remove();
                }
                else{

                    alert('error');
                }
            });
        }
        function getSkills(){


            $.get('/profile/getSkills/'+$("#client_id").val(),function(response){

                if(response.status==200) {
                    $(response.data).each(function(key,value){

                        addRowSkill(value.name,value.id,value.pivot.jobseeker_id);

                    });
                }

            });

        }
        function saveskill(){

            var url='/profile/saveSkill';
            $.post(url,{'skills':$('#skills').val(),'joobseeker_id':$('#client_id').val()},function(response){

                if(response.status==200){



                    $(response.data).each(function(key,value){

                        addRowSkill(value.name,value.id,value.pivot.jobseeker_id);

                    });                }


            });
        }




        $(document).ready(function(){




            var config = {
                '.chosen-select'           : {},
                '.chosen-select-deselect'  : {allow_single_deselect:true},
                '.chosen-select-no-single' : {disable_search_threshold:15},
                '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
                '.chosen-select-width'     : {width:"100%"}
            }
            for (var selector in config) {
                $(selector).chosen(config[selector]);
            }


            getWorks();
            getCertications();
            getLanguages();
            getSkills();

            $("#savePassword").click(function(){

                var url='/profile/savePassword';
                if($('#password').val()!=$('#password_confirmation').val()) {
                    swal('Alerta','Las contraseñas no coinciden','warning');

                }
                else {
                    swal({   title: "",
                        text: "Se Cambiara la contraseña esta seguro de continuar?. este cambio se realizara en al proximo inicio de sesion",
                        type: "info",
                        showCancelButton: true,
                        closeOnConfirm: false,
                        showLoaderOnConfirm: true,
                    }, function(){
                        $("#savePassword").attr('disabled',true);
                        $.post(url, {
                            password: $('#password').val(),
                            repassword: $('#password_confirmation').val()
                        }, function (response) {
                            if(response.status==200) {
                                swal('', 'Contraseña guardada satisfactoriamente', 'success');
                                $('#password').attr('disabled',true);
                                $('#password_confirmation').attr('disabled',true);
                            }
                            else {
                                swal('Error', 'Ocurrio un error', 'danger');
                                $("#savePassword").attr('disabled',false);
                            }


                        });
                    });

                }

            });


            $('#tabs').tab();
            var sw=0;
            var $image = $(".image-crop > img")

            $($image).cropper({

                aspectRatio: 1.018,

                preview: ".img-preview",
                done: function(data) {

                    // Output the result data for cropping image.

                }

            });



            var $inputImage = $("#inputImage");

            if (window.FileReader) {

                $inputImage.change(function() {
                    //validando el tamanno

                    var sizeByte = this.files[0].size;

                    var siezekiloByte = parseInt(sizeByte / 1024);



                     if(siezekiloByte > 100){

                        $("#alert_image_size").removeClass('hide');

                        $(this).val('<?php if($user_profile->avatar != ""){ echo $user_profile->avatar; } ?>');



                     }

                     else{

                        var fileReader = new FileReader(),

                                files = this.files,

                                file;



                        if (!files.length) {

                            return;

                        }



                        file = files[0];



                        if (/^image\/\w+$/.test(file.type)) {

                            fileReader.readAsDataURL(file);

                            fileReader.onload = function () {

                                //$inputImage.val("");

                                $image.cropper("reset", true).cropper("replace", this.result);

                            };

                        } else {

                            showMessage("Please choose an image file.");

                        }

                    }

                });

            } else {

                $inputImage.addClass("hide");

            }

            $("#submitButton").on('click', function(){

                $("#foto").val($image.cropper("getDataURL"));


            });

        });

        </script>

@stop

Edit: So far is I remove the script section it works, but the content section doesnt get printed?? What might be happening?

  • 写回答

1条回答 默认 最新

  • douchilian1009 2016-09-11 06:51
    关注

    Apparently when uploading it for some reason it was getting minified, everything in 1 line. And that caused an error in parsing. Not really sure why the code was getting minified, i'm using filezilla, sftp.

    评论

报告相同问题?

悬赏问题

  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示