あなたが呼んでいる
@extends('layouts.master')
を持っている
@yield('scripts')
しかし、セクションスクリプトを宣言していますforms/search.blade.php
したがって、正しく調べると、間違ったブレード テンプレートでスクリプトを宣言している、または間違ったブレード テンプレートに yield 領域を配置しているlayouts/master.blade.php
.何も拡張しないので、 @section を宣言しても問題ありません。
あなたが望むものを達成するために、
@section('scripts')
some scripts here
@stop
セクションはmain.blade.php
ファイルにある必要があります..
私がそれをするつもりなら、それは次のようになります:
レイアウト/master.blade.php
<html>
<head>
<!-- more stuff here -->
@yield('scripts')
<!-- or put it in the footer if you like -->
</head>
<body>
@yield('search-form')
@yield('content')
</body>
</html>
フォーム/search.blade.php
//do whatever here
main.blade.php
@extends('layouts/master')
@section('scripts')
{{ HTML::script('assets/js/search-form.js') }}
@stop
@section('search-form')
@include('forms/search')
@stop
または、master.blade.phpとmain.blade.php@yield('search-form')
を完全に削除して、次のようにします。
@section('scripts')
{{ HTML::script('assets/js/search-form.js') }}
@stop
@section('content')
@include('forms/search')
<!-- other stuff here -->
@stop