mercredi 29 juin 2016

location.href in double quote : Laravel 5.2

My code for select is below

<select id="ddlLanguages" class="form-control">
    @foreach($Languages as $Language) 
        <option onchange="location.href = {!! URL('Tr/' . '/' . $Language->LID) !!}" 
              value="{!! $Language->LanguageID !!}">{!! $Language->Language !!}</option>
    @endforeach
</select>

This produces below html

<select id="ddlLanguages" class="form-control">
    <option onchange="location.href = http://localhost/Learning/public/Translation/1" 
                    value="1">English</option>
    <option onchange="location.href = http://localhost/Learning/public/Translation/2" 
                    value="2">French</option>
</select>

Problem is this part "location.href = http://localhost/Learning/public/Translation/1" I am missing some formatting in the URL.

Can you guide me the correct path?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire