laravel怎么引入css和js文件?

PHPz
Release: 2020-09-04 14:01:35
Original
4064 people have browsed it

laravel怎么引入css和js文件?

laravel引入css和js文件的方法:

laravel默认从public开始,所以静态文件放到public下开始,只需要把你想要加载的css文件和js文件放入public文件夹中即可。

这里以我用得layui为例:

38c31e5d6cfbd9f755798f9dc0dc92f.png

在项目文件中加载即可:

  <link rel="stylesheet" href="{{URL::asset(&#39;layui-v2.5.4/layui/css/layui.css&#39;)}}">
  <script type="text/javascript" src="{{ URL::asset(&#39;layui-v2.5.4/layui/layui.js&#39;) }}"></script>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!