How to pass a url on full calendar?

0

In my url variable I want to pass all the fields of a query last name paternal and maternal but in the navigation bar shows & "amp;" There will be a way to remove it

I leave the code

@section('javascript')
<script>
$(document).ready(function() {

    // page is now ready, initialize the calendar...

    $('#calendar').fullCalendar({
        header: {
        left: 'prev,next ',
        center: 'title',
        right: 'month, agendaWeek, agendaDay, listWeek'
        },

        eventLimit: true,
        weekends: false, // will hide Saturdays and Sundays
        @if(count($citas) > 0)
            events: [
                @foreach($citas as $cita)
                {
                    title: '{{ $cita->folio_cita.' '.$cita->nombre.' '.$cita->apellido_paterno.' '.$cita->apellido_materno }}',
                    start: '{{ $arrcitas[$cita->id]["start"] }}',
                    url: '{{ url('/defensoria/promoventesregistro/nuevopromovente?nombre='.$cita->nombre.'&apaterno='.$cita->apellido_paterno."&amaterno=".$cita->apellido_materno)}}',
                    type: 'GET',

                },

                @endforeach
            ]
         @endif
        });

});
</script>
@endsection
    
asked by Ivan 18.04.2017 в 21:39
source

1 answer

0

You create the url as a string and you separate them with ? :

url: '/defensoria/promoventesregistro/nuevopromovente?nombre='+{{$cita->nombre}}+'?apaterno='+{{$cita->apellido_paterno}}+"?amaterno="+{{$cita->apellido_materno}}+'',

Suggestion:

A better option would be to pass it along the route as proposed by laravel :

Route::get('defensoria/promoventesregistro/{nombre}/{apaterno}/{amaterno}', 'DireccionDelController@promoventesregistro');

In the controller you call the vista and send the variables.

public function promoventesregistro($nombre, $apaterno, $amaterno){
    return view ('vista.index', compact('nombre','apaterno','amaterno'));
}
    
answered by 18.04.2017 в 22:18