I have a view
that includes another view
. I want these same views to include a javascript in the section of view
main called javascripts
.
So:
#layout.blade.php
<head>@yield('javascripts')</head>
<div id="container">@yield('container')</div>
In my view
where I use to register the users I have the following:
#usuario/cadastra.blade.php
@extends('layout')
@section('container')
<form>
@include('usuarios._form', ['botao' => 'Cadastrar');
</form>
@stop
@section('javascripts')
{{ HTML::script('js/usuarios/cadastra.js') }}
@stop
This is another view, which is used in include, which is usuarios._form
.
# usuario._form.blade.php
<!-- Meu formulário aqui -->
@section('javascripts')
{{ HTML::script('js/usuarios/_form.js') }}
@stop
I need the two javascript included in @section('javascripts')
to appear together, but only the last one, which is the view usuarios/cadastra.blade
, appears.
How can I make the two appear together?