使用刀片布局来扩展模板

时间:2016-01-09 18:59:30

标签: twitter-bootstrap laravel-5 laravel-blade

我是laravel.i的新来者。我正在尝试使用刀片布局扩展模板,但它失败了。因为导航栏和页脚几乎固定了所有网页所以我试图将导航栏和页脚放在父页面中它将会可扩展到中间内容页面,这意味着子页面。

以下主页代码。

  

视图/引导/布局/ master.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta charset="UTF-8">
  <title>@yield('title')</title>
  {!!Html::style('css/bootstrap.min.css')!!}
  
</head>
<body>

@section('navbar')
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>
      <form class="navbar-form navbar-left" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
@show

@yield('content')

@section('footer')
<h3>This is Footer section </h3>
@show
{!!Html::script('js/jquery.min.js')!!}
{!!Html::script('js/bootstrap.min.js')!!}
</body>
</html>

以下儿童页面代码

  

视图/引导/ about.blade.php

@extends('layouts.master')
@section('title', 'Bootstrap-About')

@section('content')

<nav>
  <li>Mamun</li>
  <li>Web Developer</li>
  <li>Bangla Trac Miaki Vas Ltd.</li>
  <li>Banani</li>
</nav>

@stop

上面的代码只显示其他内容值。但是如果我只将它们放在一个页面上就可以完美地运行。

1 个答案:

答案 0 :(得分:0)

我认为您正在尝试扩展错误的主视图。如果你的master.blade在views / bootstrap / master.blade.php中,那么

ile <- ncol(dat)
nazwy <- colnames(dat)
for(i in 1:ncol(dat)){

    ktory <- which(limits$NAME==nazwy[i])
    ul <- limits$UL[ktory]
    ll <- limits$LL[ktory]
    ile[i] <- sum(dat[, i] <=ul & dat[, i]>=ll)

    if(i==ncol(dat)) names(ile) <- nazwy
}
ile

> ile
A B C 
1 3 1