0
I have a view
which includes another view
. I want these same views to include a javascript in view
main call javascripts
.
Thus:
#layout.blade.php
<head>@yield('javascripts')</head>
<div id="container">@yield('container')</div>
In my view
where I use to register users 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
.
#users. _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')
appear together, but only the last one appears, which is the view usuarios/cadastra.blade
.
How can I get the two of you to show up together?
Hehe, cool... This one I didn’t know.
– Wallace Maxters