简体   繁体   English

如何在laravel5的bootstrap折叠面板中使用@include()

[英]how to use @include() inside bootstrap collapse panel in laravel5

I'm new to laravel. 我是laravel的新手。 And want to call the file inside the collapse panel. 并希望在折叠面板中调用文件。 When I use @include() inside tab-pane its not working properly... That file is not displaying... 当我在选项卡窗格中使用@include()时,它无法正常工作...该文件未显示...

<ul class="nav nav-tabs" id="noorsitab">
    <li><a href="#equipment" data-toggle="tab"> {!! trans('noorsi.equipment.title') !!}</a></li>
</ul>

<div class="tab-pane" id="equipment">
    @include('customer.form')
</div>

I tried many methods to bring it out.. But I couldn't... Can anyone help??? 我尝试了很多方法将其展示出来。.但是我不能...有人可以帮忙吗? Thanks in advance... 提前致谢...

You need to make sure you have a view with the path resources\\views\\customer\\form.blade.php then this should work. 您需要确保您具有一个带有路径resources\\views\\customer\\form.blade.php然后才可以使用。

Also, see my previous answer for a full view of how @include works How to include a sub-view in Blade templates? 另外,请参阅我先前的答案以获取有关@include 如何工作的完整视图。如何在Blade模板中包括子视图?

Enable tabbable tabs via JavaScript (each tab needs to be activated individually): 通过JavaScript启用可选项卡的选项卡(每个选项卡需要单独激活):

$('#equipment a').click(function (e) {
  e.preventDefault()
  $(this).tab('show')
})

You can activate individual tabs in several ways: 您可以通过以下几种方式激活各个选项卡:

$('#equipment a[href="#profile"]').tab('show') // Select tab by name
$('#equipment a:first').tab('show') // Select first tab
$('#equipment a:last').tab('show') // Select last tab
$('#equipment li:eq(2) a').tab('show') // Select third tab (0-indexed)

Write any of these code inside <script></script> tag. <script></script>标记内编写任何这些代码。

Source: http://getbootstrap.com/javascript/#tabs 来源: http : //getbootstrap.com/javascript/#tabs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM