Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5.1罐';无法使用@yield找到模板_Php_Laravel 5.1 - Fatal编程技术网

Php Laravel 5.1罐';无法使用@yield找到模板

Php Laravel 5.1罐';无法使用@yield找到模板,php,laravel-5.1,Php,Laravel 5.1,我在从一个视图到另一个视图中使用@yield时遇到问题。我无法从我的question.blade.php文件中获得任何信息,即使只使用一个简单的文本 我的create.blade.php文件: @extends('layout/layoutAdmin') @section('content') <div class="container"> <h1>Add a new inventory</h1> {!! Form::open(['url' =&

我在从一个视图到另一个视图中使用@yield时遇到问题。我无法从我的question.blade.php文件中获得任何信息,即使只使用一个简单的文本

我的create.blade.php文件:

@extends('layout/layoutAdmin')


@section('content')  
<div class="container">
  <h1>Add a new inventory</h1>

{!! Form::open(['url' => 'admin/menu/inventories/', 'method' => 'POST']) !!}    
  <div class="row">
    <div class="form-group col-xs-8 col-md-7 {!! $errors->has('text') ? 'has-error' : '' !!}">
  {!! Form::label('text', 'Name:') !!}
  {!! Form::text('text', null,['class' => 'form-control']) !!}
  {!! $errors->first('text', '<span class="help-block">:message</span>') !!}
</div>

<div class="form-group col-xs-8 col-md-7">
  {!! Form::label('description', 'Description:') !!}
  {!! Form::textarea('description', null, ['class' => 'form-control']) !!}
</div>
  @yield('content2')
</div>
</div>
  {!! Form::close() !!}

@stop
@extends('inventory.create')

@section('content2')


 <div class="form-group col-xs-8 col-md-7">
      {!! Form::label('type', 'Type:') !!}
      {!! Form::number('type', null, ['class' => 'form-control']) !!}
</div>    
<div class="form-group col-xs-8 col-md-7 {!! $errors->has('introduction') ? 'has-error' : '' !!}">
  {!! Form::label('introduction', 'Introductory Text:') !!}
  {!! Form::textarea('introduction', null, ['class' => 'form-control']) !!}
  {!! $errors->first('introduction', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group col-xs-8 col-md-7">
  {!! Form::label('value', 'Values:') !!}
  {!! Form::textarea('value', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group col-xs-8 col-md-7 {!! $errors->has('language') ? 'has-error' : '' !!}">
  {!! Form::label('language', 'Language:') !!}
  {!! Form::text('language', null, ['class' => 'form-control']) !!}
  {!! $errors->first('language', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group col-xs-8 col-md-7">
    {!! Form::label('is_active', 'Active:') !!}
    {!! Form::checkbox('is_active', null, ['class' => 'form-control']) !!}
  </div>


@stop
路线:

Route::get('admin/menu/inventories/new/question', 'QuestionController@create');

编辑:修复了打字错误

您将屈服于一个名为
container2
的部分,您将内容放置在一个名为
content2
的部分您将屈服于一个名为
container2
的部分,您将内容放置在一个名为
content2
的部分是的,对不起。当我将代码重新写入stackoverflow时,这是一个输入错误。我将@yield('container2')更改为@yield('content2'),但仍然不起作用。@randomuser33尝试将
@stop
替换为
@endsection
。您是否收到错误页面,或者您发布的代码的结果是什么?是的,对不起。当我将代码重新写入stackoverflow时,这是一个输入错误。我将@yield('container2')更改为@yield('content2'),但仍然不起作用。@randomuser33尝试将
@stop
替换为
@endsection
。您是否收到错误页面,或者您发布的代码的结果是什么?
Route::get('admin/menu/inventories/new/question', 'QuestionController@create');