Laravel blade added to section that does not work properly

I want to write to the area in my template from the view, as well as from the included view, the first view, but no matter what I tried, it does not work. I tried using @parent and @append, but nothing gave the result that I want so far.

In my layout, I have the following:

@yield('scripts')

In my opinion, I have the following:

@include('admin/rules/partials/_form')

@section('scripts)
    // javascript #1 here
@stop

In admin / rules / partials / _form, I have the following:

@section('scripts)
    // javascript #2 here
@stop

, , @parent @section ('scripts'), @append @stop, script. , , - javascript # 1, javascript # 2 - . , ?

+4
2

, , :

@yield('scripts')

, :

@include('admin/rules/partials/_form')

@section('scripts)
    // javascript #1 here
@stop

admin/rules/partials/_form :

@section('scripts)
    @parent
    // javascript #2 here
@overwrite
+4

.

, .

EDIT, . javascript .

tests.layout.blade.php

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>
            @yield('title') - test
        </title>
        @yield('head')
    </head>
    <body>

    @yield('content')

    @yield('javascript')
    </body>
</html>

tests.page.blade.php

@extends('layouts.default')
@section('title', 'Poses')

@section('content')
    <div class="container">
        <div class="row">
            @include('tests.partials.one')
            @include('tests.partials.two')
        </div>
    </div>
@stop

tests.partials.one.blade.php

@section('content')
    @parent
    <h1>One</h1>
@stop

@section('javascript')
    @parent
    <script>Scripts from one</script>
@stop

tests.partials.two.blade.php

@section('content')
    @parent
    <h1>Two</h1>
@stop

@section('javascript')
    @parent
    <script>Scripts from two</script>
@stop

: http://laravel.com/docs/5.0/templates

0

All Articles