Laravel印刷@section

时间:2016-09-10 19:43:42

标签: php laravel blade

我遇到问题:'如果没有先启动一个部分,就无法结束部分。'

当我发表评论时:

@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

on factory.php

我认为视图实际上是打印@section(&#39;脚本&#39;)@ parent

代码有点长,我会删除html,我认为它不是问题的一部分,我让部分脚本完整,因为它是由于某种原因打印出来的。

UPDATE Vt_clients 
SET cl_postal_code = CONCAT([cl_postal_code]=+":")
WHERE cl_postal_code = '*'

编辑:到目前为止,我删除它工作的脚本部分,但内容部分没有打印?可能会发生什么?

1 个答案:

答案 0 :(得分:0)

显然,当出于某种原因上传它时,它变得微不足道,一切都在1行。这导致解析错误。我不确定为什么代码会缩小,我使用的是filezilla,sftp。