laravel 4头部装在体内

时间:2014-07-15 20:09:20

标签: html laravel

出于某种原因,我的脚本,......以及我在头部声明的所有内容都没有加载到head标签中,而是在body标签内。我做错什么了吗?我也应该发布控制器/路由文件吗?

我的代码: layouts-> master.blade.php

<?php
$version = [
    'jQuery-legacy' => '1.11.0', // Previous generation of jQuery
    'jQuery'        => '2.1.0',
    'jQueryMobile'  => '1.4.2',
    'lodash'        => '2.4.1',
    'modernizr'     => '2.7.1',
];
?><!doctype html>
<html lang="{{ Config::get('app.locale') }}" dir="ltr">
<head>
    <meta charset="UTF-8">
    <title>{{ HTML::entities('Partycipate') }}</title>
    {{ HTML::style('//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'); }}
    {{ HTML::script("//code.jquery.com/jquery-{$version['jQuery']}.min.js") }}
    {{ HTML::script("//cdnjs.cloudflare.com/ajax/libs/modernizr/{$version['modernizr']}/modernizr.min.js") }}
    {{ HTML::style("//code.jquery.com/mobile/{$version['jQueryMobile']}/jquery.mobile-{$version['jQueryMobile']}.min.css") }}
    {{ HTML::style('components/font-awesome/css/font-awesome.css'); }}
    {{ HTML::style("styles/global.css") }}
    {{ HTML::style('styles/navigation.css'); }}
    @yield('head')
    {{ HTML::script('//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js'); }}
</head>
<body>
@yield('navigation')
@yield('content')
{{ HTML::script("//cdnjs.cloudflare.com/ajax/libs/lodash.js/{$version['lodash']}/lodash.mobile.min.js") }}
{{ HTML::script('scripts/plug-ins/sidebar.js') }}
{{ HTML::script('scripts/plug-ins/metisMenu/jquery.metisMenu.js') }}
@yield('bottom_scripts')
</body>
</html>

然后是一个页面:

@extends('layouts.master')
@section('navigation')
    @include('navigation', ['pageActive' => 'overzicht'])
@stop
@section('styles')
@stop

@section('content')
<div class="content-container">

</div>
@stop

@section('bottom_scripts')
    {{ HTML::script("scripts/plug-ins/calendar/moment-2.5.1.js") }}
    {{ HTML::script("scripts/overzicht.js") }}
@stop

呈现的HTML:

<html lang="en" dir="ltr" 
<head></head>
<body>
    <meta charset="UTF-8">
    <title>Partycipate</title>
    <link media="all" type="text/css" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
    <link media="all" type="text/css" rel="stylesheet" href="//code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
    <link media="all" type="text/css" rel="stylesheet" href="http://localhost:8181/partycipate/public/components/font-awesome/css/font-awesome.css">
    <link media="all" type="text/css" rel="stylesheet" href="http://localhost:8181/partycipate/public/styles/global.css">
    <link media="all" type="text/css" rel="stylesheet" href="http://localhost:8181/partycipate/public/styles/navigation.css">
        <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

<div class=„content-container”>
    </div>

<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.mobile.min.js"></script>
<script src="http://localhost:8181/partycipate/public/scripts/plug-ins/sidebar.js"></script>
<script src="http://localhost:8181/partycipate/public/scripts/plug-ins/metisMenu/jquery.metisMenu.js"></script>
    <script src="http://localhost:8181/partycipate/public/scripts/plug-ins/calendar/moment-2.5.1.js"></script>
    <script src="http://localhost:8181/partycipate/public/scripts/overzicht.js"></script>

</body></html>

这有什么问题?

1 个答案:

答案 0 :(得分:0)

我唯一能看到的是你的HTML :: style / script中有一些尾随的分号,它们不应该存在。