Support the ongoing development of Laravel.io →
Views Blade
Last updated 2 years ago.
0

Typically i do something like this:

Under this section create a section

{{ HTML::script('http://cdn.datatables.net/1.10.0/js/jquery.dataTables.js') }}

{{-- custom script that loads on every page think UI elements you use in bootstrap, foundation, jqui --}}
<script type="text/javascript" src="{{URL::to('/')}}/js/app.js"> < /script>

@yield('scripts')

Adding a section allows you to edit this section as customization is required in your views.

@extends('site.layouts.default')
{{-- Web site Title --}}
@section('title')
{{{ Lang::get('site.contact_us') }}} ::

@stop

{{-- Content --}}
@section('content')

{{{ Lang::get('site.contact_us') }}}

@stop

@section('scripts')
{{-- you can add a source here again or directly write the script in script tags--}}
@stop

If you want to get even more fancy you could create another blade template with your script in it so its compiled directly into your view. You can also create an asset container I believe to use the HtmlBuilder.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

donli1210 donli1210 Joined 10 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.