lundi 11 juin 2018

Insert swiper js library directly in blade template laravel 5.6

I'm newer using laravel and i need some help please.

I'm trying to include js library from swiper plugin but not like this:

<script 
src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.0/js/swiper.min.js"> 
</script> (like this is working)
or like this:
<script type="text/javascript" src=""> 
</script> 
(which is also working)

I want to put the js library code directly in the html code. I did already for jquery and bootstrap and is working good, but for swiper and font awesome is not working.

I tried a lot of things: put the code first, between, last, removed the jquery and bootstrap library.

The error received is:

Use of undefined constant index - assumed 'index' (View: 
/home/newsite/public_html/laravel/resources/views/layouts/footer.blade.php) 
(View: 
/home/newsite/public_html/laravel/resources/views/layouts/footer.blade.php)

How I did for jquery and is work:

app.blade.php

<html>
    <head>
    ---------
    </head>
    <body>
     ---------
        <script> @yield('footer') </script>
    </body>
</html>

and inside the footer.blade.php

@section('footer')

--- here js library code --- 

@endsection



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire