网络营销电子商务研究中心  
USA Web Hosting Direct
Go Back   网络营销电子商务研究中心 > 网站设计 > Laravel
User Name
Password
 
FAQ Members List Calendar 域名注册 PHP Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1   IP: 112.87.30.164
Old 2017-06-13, 01:33 AM
Reed Point Reed Point is offline
初级会员
 
Join Date: 2012-01-30
Posts: 2
Reed Point 现在声名狼藉
Default Laravel页面如何引入css/js等静态文件?

Code:
<link rel="stylesheet" href="{{ URL::asset('css/bootstrap.css') }}">
<script type="text/javascript" src="{{ URL::asset('js/jquery.min.js') }}"></script>
文件目录默认是在   public/ 自行放置即可
Code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>cheap glasses</title>

    <!-- Bootstrap core CSS -->
    <link href="{{ URL::asset('assets/css/bootstrap.min.css')}}" rel="stylesheet">
</head>

<body>
    <table class="table table-striped table-bordered table-hover">
         @foreach($data as $value)
            <tr>
                <td>{{$value->id}}</td>
                <td>{{$value->name}}</td>
                <td>{{$value->sex}}</td>
                <td>{{$value->age}}</td>
            </tr>
         @endforeach
    </table>

    <!-- jQuery -->
    <script src="{{ URL::asset('assets/js/jquery.js')}} "></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="{{ URL::asset('assets/js/bootstrap.min.js')}}"></script>
</body>
</html>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
所有时间均为 +8. 现在的时间是 01:23 AM, Free Patent & Patent Ideas