Home >Backend Development >PHP Tutorial >laravel怎么引入css和js文件?

laravel怎么引入css和js文件?

PHPz
PHPzOriginal
2016-06-06 20:27:494108browse

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>
Statement:
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