Laravel无法扩展默认刀片模板

时间:2014-04-28 07:37:10

标签: twitter-bootstrap laravel laravel-4 blade

我在导航菜单中有一个默认值,我尝试在data_edit.blade文件中扩展。网址如下所示:http://localhost:85/nih/public/bassengweb/995/editData。我真的不确定为什么它不会扩展默认正确。

这是我可以扩展的其他页面中导航菜单的样子:

enter image description here

这是它在data_edit.blade文件中的样子。当我查看源代码时,我可以看到导航的html代码。

enter image description here

default.blade.php(母版页)中的代码

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">


    <title>{{ $title }}</title>
</head>
<body>
    <link type="text/css" rel="stylesheet" href="../../public/css/bootstrap.css">
    <!-- Add custom CSS here -->
  <link type="text/css" rel="stylesheet" href="../../public/css/main.css">
  <!-- jQuery -->
    <script src="../../public/js/jquery.min.js"></script>
    <!-- JavaScript -->
    <script src="../../public/js/bootstrap.js"></script>

<?php
session_start(); 
 $_SESSION['bruker'] = Auth::user()->user_name;
?>

    <!-- Fixed navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">

        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
        </div>

        <div class="navbar-collapse collapse">
            <p class="navbar-text pull-right">
                <span class="glyphicon glyphicon-user"></span> 


<span class="label label-info" style="color:white"><a class='navbar-link {{ ($aktiv == 'minside') ? 'active' : '' }}'  >
    {{ HTML::linkRoute('user_data', 'Min side '.Auth::user()->user_name) }} </a> </span> 
         <span class="label label-danger"> {{ HTML::linkRoute('logout', 'Logg ut') }}</span></p> 




          <ul class="nav navbar-nav pull-left">

<li class='pil {{ ($aktiv == 'hvertime') ? 'active' : '' }}' > <a class='timemaling' {{HTML::linkRoute('hvertime','Timemåling')}}</a> </li>            
<li  class='pil {{ ($aktiv == 'hvertredjetime') ? 'active' : '' }}'> <a class='vannmaling' {{HTML::linkRoute('hvertredjetime','Vannmåling')}}</a </li>
<li  class='pil {{ ($aktiv == 'gjoremal') ? 'active' : '' }}'> <a class='gjoremal' {{HTML::linkRoute('gjoremal','Oppgaver')}}</a> </li>         


           <li class='pil dropdown {{ ($aktiv == 'dagvakt' || $aktiv== 'kveldsvakt' || $aktiv=='helgevakt') ? 'active' : '' }}'>
            <a    href="#" class="dropdown-toggle glyphicon glyphicon-ok" data-toggle="dropdown"><span class="glyphicon glyphicon-ok" ></span> <big>Rutiner</big> <b class="caret"></b></a>

                <ul class="dropdown-menu">
            <li class='{{ ($aktiv == 'dagvakt') ? 'active' : '' }}'> <a class='dagvakt' {{HTML::linkRoute('dagvakt','Dagvakt')}}</a> </li> 
            <li class='{{ ($aktiv == 'kveldsvakt') ? 'active' : '' }}'> <a class='kveldsvakt' {{HTML::linkRoute('kveldsvakt','Kveldsvakt')}}</a> </li>  
            <li class='{{ ($aktiv == 'helgevakt') ? 'active' : '' }}'> <a class='helgevakt' {{HTML::linkRoute('helgevakt','Helgevakt')}}</a> </li>      
              </ul>   
              </li>

<li  class='pil {{ ($aktiv == 'kontrollcm') ? 'active' : '' }}' > <a class='kontrollcm' {{HTML::linkRoute('kontrollcm','Kontroll CM')}}</a> </li> 
<li  class='pil  {{ ($aktiv == 'sok') ? 'active' : '' }}'> <a class='sok' {{HTML::linkRoute('sok','Søk')}}</a> </li>    
<li  class='pil {{ ($aktiv == 'rapport') ? 'active' : '' }}' > <a class='rapport' href='../rapport/index.php'>Rapport</a> </li>           
<li class='pil {{ ($aktiv == 'diagram') ? 'active' : '' }}'> <a class='diagram' href='../diagram/index.php'>Diagram</a> </li>   
          </ul>      
        </div><!--/.nav-collapse -->

    </div>
      <br><br>


    @yield('content')

</body>
</html>

data_edit.blade中的代码

@extends('default')

@section('content')


<h1>Redigerer måling med ID : {{ $data->id }}</h1>

@if(Session::has('message'))
    <p style="color: green;">{{ Session::get('message') }}</p>
@endif

{{ Form::open(array('url' => 'bassengweb/updateData', 'method' => 'PUT')) }}

{{ Form::label('tittel', 'Tittel') }}
@if($data->tasks->isEmpty())
    {{ Form::text('tittel', $data->measurements[0]->title, array('disabled')) }}
    {{ Form::hidden('title', $data->measurements[0]->title) }}
@else
    {{ Form::text('tittel', $data->tasks[0]->title, array('disabled')) }}
    {{ Form::hidden('title', $data->tasks[0]->title) }}
@endif

{{ Form::hidden('id', $data->id) }}

{{ Form::label('value', 'Verdi') }}
{{ Form::text('value', $data->value) }}
{{ Form::hidden('value_old', $data->value) }}

{{ Form::label('date', 'Dato') }}
{{ Form::text('date', date('d/m/Y', strtotime($data->date))) }}
{{ Form::hidden('saved_date', $data->date) }}

{{ Form::label('time', 'Tid') }}
{{ Form::text('time', $data->time) }}

{{ Form::label('emp', 'Ansatt') }}
{{ Form::select('emp', $emp, $data->emp_id) }}

{{ Form::hidden('changed_by', Auth::user()->user_name) }}

{{ Form::submit('Lagre endringer') }}

{{ HTML::linkRoute('sok', 'Tilbake til søk') }}



@stop

1 个答案:

答案 0 :(得分:0)

你不应该在你的default.blade.php中使用相对路径,因此它不会变得混乱。

<link type="text/css" rel="stylesheet" href="../../public/css/main.css">

<link type="text/css" rel="stylesheet" href="{{ URL::to('css/main.css') }}">

与您的javascript相同。