@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
我得到了这个:
错误:: Factory.php第587行中的ErrorException: 没有先开始一个部分就不能结束一个部分。 (查看:E:\ Other \ gobumpr \ resources \ views \ pages \ select.blade.php)
答案 0 :(得分:2)
在这里
@section('title'," $hotel->hotel - $city->city")
@endsection
由于您提供@endsection
的内容,因此您不需要title
。
@section()
的第二个参数被视为@section()
只需使用@section('title'," $hotel->hotel - $city->city")
答案 1 :(得分:1)
如果您使用@section('section_name', 'section_content')
语法,则该部分的内容为“section_content”。无需使用@endsection
关闭此部分。
答案 2 :(得分:1)
@section(&#39;的javascript&#39;) function myMap(){ var mapCanvas = document.getElementById(&#34; map&#34;); var mapOptions = { center:new google.maps.LatLng({{$ hotel-&gt; directions}}), zoom:10 } var map = new google.maps.Map(mapCanvas,mapOptions); } @endforeach {{ - - }} @endsection
@endsection需要在@endforeach之前。
答案 3 :(得分:0)
尝试删除部分('标题')之后的@endsection它将修复它。
答案 4 :(得分:0)
删除@endsection
将解决此问题。我正在尝试在@yield('title')
中添加带有<title></title>
的标题页,并提供不包含@section('title', 'pageTitle')
的{{1}}。
答案 5 :(得分:0)
您冒昧地忘记了单词部分前的'@'
答案 6 :(得分:0)
在刀片模板中不能同时使用@stop或@endsection(仅一个)。 您应该在@section之后使用@stop或@endsection 例如
可以使用
@section('testing')
<h1>kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk</h1>
@endsection
它不起作用
@section('testing')
<h1>kjfdgjkfdgfd kjgkdfhgdljkfs hgdfhgjk</h1>
@endsection
@stop