0

i have a question related to Laravel 4 Starter Site

The following is one of the view page.

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

@stop

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

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

@stop

In the site.layouts.default template, Jquery is included. How could i include other javascript like

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

into the view file? It should included after the jquery library.

Thanks in advance!

1 Answer 1

1

You may use:

@section('scripts')
    {{ HTML::script('...') }}
@stop

Anywhere in your view after @extends('...'). Because there is @yield('scripts') in the bottom of the layout, right after the scripts (jQuery and BootStrap).

This is another example:

{{-- Scripts --}}
@section('scripts')
    <script type="text/javascript">
        $(document).ready(function() {
            //...
        });
    </script>
@stop
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.