Php 如果不先在Laravel中启动一个节,则无法结束该节 @extends('main')) @foreach($酒店作为$酒店) @foreach($city作为$city) @章节(‘标题’,“$酒店->酒店-$城市->城市”) @端部 @节(“内容”) {{--头--} @包括('partials.\u nav') {{$hotel->hotel}} {{$city->city} @endforeach {{--结束搜索栏--} {{--Header End here--} {{--Modal Closed--}} {{--Tab从这里开始--} 联络电话。 {{$hotel->contactno} {{{$hotel->remark} 菜系 {{$hotel->cuisines} 成本 {{$hotel->cost} 营业时间 {{date('h:ia',strotime($hotel->openfrom))}-{{date('h:ia',strotime($hotel->opento))} 地址 {{{$hotel->address} 集锦 {{{$hotel->highlight} 精选系列 {{$hotel->featured} # 盘子 价格 @foreach($menu作为$menu) {{$menu->id} {{$menu->dish_name} {{$menu->price} @endforeach {{--discs从这里开始--} /** *建议的配置变量:编辑并取消注释下面的部分,以插入来自平台或CMS的动态值。 *了解定义这些变量的重要性:https://disqus.com/admin/universalcode/#configuration-变数*/ /* var discus_config=函数(){ this.page.url=page\u url;//用页面的规范url变量替换page\u url this.page.identifier=page\u identifier;//用页面的唯一标识符变量替换page\u identifier }; */ (函数(){//不要在此行下方编辑 var d=document,s=d.createElement('script'); s、 src='//gobumpr.disqs.com/embed.js'; s、 setAttribute('data-timestamp',+new Date()); (d.头| | | d.身体)附肢儿童; })(); 请启用JavaScript以查看 {{--discs在这里结束--} {{--Tab End Here--} @端部 @节(“javascript”) 函数myMap(){ var mapCanvas=document.getElementById(“map”); 变量映射选项={ 中心:新的google.maps.LatLng({{{$hotel->directions}), 缩放:10 } var map=new google.maps.map(mapCanvas,mapOptions); } @endforeach {{-- --}} @端部
我明白了: 错误:: Factory.php第587行中的ErrorException: 如果不先开始一个节,则无法结束该节。(视图:E:\Other\gobumpr\resources\views\pages\select.blade.php) 如果使用Php 如果不先在Laravel中启动一个节,则无法结束该节 @extends('main')) @foreach($酒店作为$酒店) @foreach($city作为$city) @章节(‘标题’,“$酒店->酒店-$城市->城市”) @端部 @节(“内容”) {{--头--} @包括('partials.\u nav') {{$hotel->hotel}} {{$city->city} @endforeach {{--结束搜索栏--} {{--Header End here--} {{--Modal Closed--}} {{--Tab从这里开始--} 联络电话。 {{$hotel->contactno} {{{$hotel->remark} 菜系 {{$hotel->cuisines} 成本 {{$hotel->cost} 营业时间 {{date('h:ia',strotime($hotel->openfrom))}-{{date('h:ia',strotime($hotel->opento))} 地址 {{{$hotel->address} 集锦 {{{$hotel->highlight} 精选系列 {{$hotel->featured} # 盘子 价格 @foreach($menu作为$menu) {{$menu->id} {{$menu->dish_name} {{$menu->price} @endforeach {{--discs从这里开始--} /** *建议的配置变量:编辑并取消注释下面的部分,以插入来自平台或CMS的动态值。 *了解定义这些变量的重要性:https://disqus.com/admin/universalcode/#configuration-变数*/ /* var discus_config=函数(){ this.page.url=page\u url;//用页面的规范url变量替换page\u url this.page.identifier=page\u identifier;//用页面的唯一标识符变量替换page\u identifier }; */ (函数(){//不要在此行下方编辑 var d=document,s=d.createElement('script'); s、 src='//gobumpr.disqs.com/embed.js'; s、 setAttribute('data-timestamp',+new Date()); (d.头| | | d.身体)附肢儿童; })(); 请启用JavaScript以查看 {{--discs在这里结束--} {{--Tab End Here--} @端部 @节(“javascript”) 函数myMap(){ var mapCanvas=document.getElementById(“map”); 变量映射选项={ 中心:新的google.maps.LatLng({{{$hotel->directions}), 缩放:10 } var map=new google.maps.map(mapCanvas,mapOptions); } @endforeach {{-- --}} @端部,php,laravel,laravel-blade,Php,Laravel,Laravel Blade,我明白了: 错误:: Factory.php第587行中的ErrorException: 如果不先开始一个节,则无法结束该节。(视图:E:\Other\gobumpr\resources\views\pages\select.blade.php) 如果使用@section('section\u name','section\u content')语法,则节的内容为“section\u content”。无需使用@endsection关闭此节 在这里检查 @extends('main')
@section('section\u name','section\u content')
语法,则节的内容为“section\u content”。无需使用@endsection
关闭此节
在这里检查
@extends('main')
@foreach ($hotel as $hotel)
@foreach ($city as $city)
@section('title'," $hotel->hotel - $city->city")
@endsection
@section('content')
{{-- Header --}}
<div style="background-image:url('../img/{{ $hotel->id }}.jpg'); height:400px; background-size:cover;">
<div class="container">
@include('partials._nav')
<div class="row">
<center>
<h2>
<div class="col-md-12 hotel-name">
{{ $hotel->hotel }}
<p class="city">
</h2>
{{ $city->city }}
@endforeach
</p>
</div>
</center>
</div>
</div>
{{-- End Search bar --}}
</div>
</div>
{{-- Header End here --}}
</div>
</div>
</div>
{{-- Modal Closed --}}
<div class="container">
{{-- Tab Start here --}}
<div class="tabs">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Overview</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Menu</a></li>
<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Comments <span class="disqus-comment-count" data-disqus-identifier="article_1_identifier"></span></a></li>
<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Photo</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="home">
<div class="row">
<div class="col-md-3">
<h3>Contact No.</h3>
<p class="contactno">{{ $hotel->contactno }}</p>
<p class="remark">{{ $hotel->remark }}</p>
<h3>Cuisines</h3>
<p class="cuisines">{{ $hotel->cuisines }}</p>
<h3>Cost</h3>
<p class="cost">{{ $hotel->cost }}</p>
</div>
<div class="col-md-3">
<h3>Opening Hours</h3>
<p class="hours">{{ date('h:ia', strtotime($hotel->openfrom)) }} - {{ date('h:ia', strtotime($hotel->opento)) }}</p>
<h3>Address</h3>
<p class="address">{{ $hotel->address }}</p>
<div id="map" style="width:150px;height:100px;"></div>
</div>
<div class="col-md-3">
<h3>Highlights</h3>
<p class="highlight">{{ $hotel->highlight }}</p>
<h3>Featured in Collection</h3>
<p class="featured">{{ $hotel->featured }}</p>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="profile">
<table class="table">
<tr>
<th>#</th>
<th>Dish</th>
<th>Price</th>
</tr>
@foreach ($menu as $menu)
<tr>
<td>{{ $menu->id }}</td>
<td>{{ $menu->dish_name }}</td>
<td>{{ $menu->price }}</td>
</tr>
@endforeach
</table>
</div>
<div role="tabpanel" class="tab-pane" id="messages">
{{-- Disqus Start from here --}}
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//gobumpr.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
{{-- Disqus End Here --}}
<div role="tabpanel" class="tab-pane" id="settings"></div>
</div>
</div>
{{-- Tab End Here --}}
</div>
@endsection
@section('javascript')
<script>
function myMap() {
var mapCanvas = document.getElementById("map");
var mapOptions = {
center: new google.maps.LatLng({{ $hotel->directions }}),
zoom: 10
}
var map = new google.maps.Map(mapCanvas, mapOptions);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?callback=myMap"></script>
<script id="dsq-count-scr" src="//gobumpr.disqus.com/count.js" async></script>
@endforeach
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDu9JV__AvYU6auWV-QsJuV82TnLtrytm0&callback=initMap" async defer></script> --}}
@endsection
您不需要@endsection
,因为您为标题提供了内容
<代码> @段()<代码>的第二个参数被认为是<代码> @段()/<代码> /p>的内容。
只需使用
@section('title',“$hotel->hotel-$city->city”)
@节(“javascript”)
函数myMap(){
var mapCanvas=document.getElementById(“map”);
变量映射选项={
中心:新的google.maps.LatLng({{{$hotel->directions}),
缩放:10
}
var map=new google.maps.map(mapCanvas,mapOptions);
}
@endforeach
{{-- --}}
@端部
@endsection必须位于@endforeach之前 尝试删除节(“标题”)后面的@endsection,它将修复该问题。删除@endsection
将解决该问题。我试图在
中添加带有@yield('title')
的标题页,并在刀片模板中提供@section('title','pageTitle')
而不使用@endsection
您会防御性地忘记section之前的“@”在刀片模板中使用@stop或@endsection(只有一个)而不是两者。
您应该在@section之后使用@stop或@endsection
比如说
会有用的
@section('title'," $hotel->hotel - $city->city")
@endsection
@节(“测试”)
kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk
@端部
这行不通
@section('testing')
<h1>kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk</h1>
@endsection
@节(“测试”)
kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk
@端部
@停止
删除@endsection部分后,我仍然会收到该错误删除@endsection部分后,我仍然会收到该错误确保执行php artisan视图:清除 @section('testing')
<h1>kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk</h1>
@endsection
@stop