扫码关注官方订阅号
有的时候用这两个似乎都可以? 具体有什么不同呢?
闭关修行中......
function url($path = null, $parameters = [], $secure = null) function asset($path, $secure = null)
一般asset用于引用静态文件 css js img 等
asset()方法用于引入 CSS/JavaScript/images 等文件,文件必须存放在public文件目录下。url()方法生成一个完整的网址。
asset()
CSS/JavaScript/images
public
url()
参考:What is the difference between the two and in which cases I should use one or another?
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
一般asset用于引用静态文件 css js img 等
asset()
方法用于引入CSS/JavaScript/images
等文件,文件必须存放在public
文件目录下。url()
方法生成一个完整的网址。参考:What is the difference between the two and in which cases I should use one or another?