Laravel 5:Class' HTML'即使已安装包,也找不到

时间:2015-05-28 14:46:42

标签: html laravel-5 blade

我知道这不再是嵌入式软件包。在我的composer.json我有:

"require": {
    ...stuff...
    "illuminate/html": "5.*"
}, etc.

app.php我有:

'providers' => [
    ...stuff...
    'Illuminate\Html\HtmlServiceProvider',
    ...more stuff...
],
'aliases' => [
    ...stuff...
    'Html' => 'Illuminate\Html\HtmlFacade'
], etc.

我已经运行composer update,为什么我在使用HTML::script()时无法识别?这是抛出错误的Blade模板:

<!DOCTYPE HTML>

<html lang="en">

<!-- USER LOGIN SECURITY -->
<!-- require('redis-session.php');
RedisSession::start();

@if (!isset($_SESSION['HTTP_SHIB_EP_EMAILADDRESS']))
    header('Location: https://resviz.ncl.ac.uk/signin?redirect=https://resviz.ncl.ac.uk/wos/index.php');
    die();
@endif -->

<head>
    <title>Academic Intelligence</title>

    <!-- LINKS -->

    <!-- local css file -->
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <!-- Corporate visual identity -->
    <link href="//resviz.ncl.ac.uk/static/style/cvi.css" media="screen" rel="stylesheet" type="text/css" />
    <!-- bootstrap css -->
    <link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.0/readable/bootstrap.min.css" rel="stylesheet">

    <!-- fonts -->
    <link href='https://fonts.googleapis.com/css?family=Raleway:700' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700' rel='stylesheet' type='text/css'>

    <!-- META -->

    <meta charset="UTF-8"/>
    <!-- ensure proper rendering and touch zooming in mobile devices -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=10" />

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <!-- BREADCRUMBS -->
    <div class="sg-orientation">    
        <a href="#content" class="sg-button sg-skiptocontent">Skip to Content</a>
        <span class="sg-breadcrumbs">
            <a href="http://www.ncl.ac.uk/">Newcastle University</a> &gt;&gt;
            <a href="https://resviz.ncl.ac.uk/">Research Visualisation</a> &gt;&gt;
            <strong href="#">Academic Intelligence</strong>
        </span>
    </div>

    <!-- TITLE BAR -->
    <div class="sg-titlebar">
        <h1><a title="Newcastle University Homepage" accesskey="1" href="http://www.ncl.ac.uk/"/><span title="Newcastle University">Newcastle University</span></a></h1>
        <h2><a href="https://resviz.ncl.ac.uk/wos/">Academic Intelligence</a></h2>
    </div> 


    <div class="sg-navigation">&nbsp;</div>

    <div class="sg-content">
        <!-- NAVIGATION BAR -->
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li><a href="{{ action('PagesController@index') }}"><span class="glyphicon glyphicon-home"></span></a></li>
                        <li><a href="{{ action('PagesController@about') }}">About</a></li>
                    </ul>
                </div> <!-- navbar-collapse -->
            </div> <!-- container -->
        </nav> <!-- navbar -->

        <!-- main content -->
        <section class="container">

            {{-- unique section to other pages --}}
            @yield('content')

        </section> <!-- main content; container -->
    </div> <!-- sg-content -->

    <!-- FOOTER -->
    <div class="sg-clear">&nbsp;</div>
    <div class="sg-footer">
        <p>Research &amp; Enterprise Services<br/>Newcastle University, Newcastle Upon Tyne,<br/>NE1 7RU, United Kingdom<br/><a href="mailto:res.policy@ncl.ac.uk">Email Webmaster</a><br/><br/>&copy; {{ date('Y') }} Newcastle University</p>
    </div>

    <!-- SCRIPTS -->

    <!-- jquery -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- local script -->
    {{ HTML::script('js/script.js') }}
    <!-- bootstrap js -->
    {{ HTML::script('//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js')}}
    <!-- angularJS -->
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
    <!-- check browser version, if outdates, prompt for update -->
    <script src="//browser-update.org/update.js"></script>

</body>

</html>

我正在将这个现有的Web应用程序移动到Laravel中,因此我正在尝试实现各种Blade组件。在这种情况下,将<script src="script.js"></script>更改为{{ HTML::script('js/script.js') }}。我无法理解为什么虽然不能识别HTML类......

0 个答案:

没有答案