我的Laravel布局目前如下(删除导航栏等):
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.4/flatly/bootstrap.min.css"
rel="stylesheet">
<link href="{{ asset('/css/app.css') }}" rel="stylesheet">
<!-- Fonts -->
<link href='//fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet'
type='text/css'>
<!-- Scripts -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- 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>
<div class="container">
@yield('content')
</div>
<!-- Scripts -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="{{ asset('assets/vendor/toastr/toastr.min.js') }}"></script>
</body>
</html>
然后,我将视图附加到布局:
@extends('app')
@section('content')
Content here.
@endsection
我很困惑,比如说,如果我在clinicController.php
或在一个诊所路由(这是一个资源),然后"注入"一个样式表和一个Javascript文件到适当的地方.
有办法做到这一点吗?我想@if on a certain page, display this
个就行了,但我相信一定有更"拉威尔"的方法来做到这一点?
任何帮助都将不胜感激.