如何在Cakephp 3中的webroot目录中添加带有自定义名称的自定义文件夹(How to add custom folder with custom name inside webroot di

编程入门 行业动态 更新时间:2024-10-18 16:45:45
如何在Cakephp 3中的webroot目录中添加带有自定义名称的自定义文件夹(How to add custom folder with custom name inside webroot directory in Cakephp 3)

我想在我的webroot目录中添加dist文件夹并从视图中访问它,例如

|_webroot |_js |_img |_dist

并访问它是这样的:

echo $this->Html->dist('filename.ext', ['alt' => '']);

请给出一些解决方案。 谢谢

I want to add dist folder inside my webroot directory and access it from view for eg

|_webroot |_js |_img |_dist

and access it something like this:

echo $this->Html->dist('filename.ext', ['alt' => '']);

Please give some solution. Thanks

最满意答案

为什么不像这样访问它?

$this->Html->css('/dist/example.css'); $this->Html->script('/dist/example.js');

Why not accessing it like this?

$this->Html->css('/dist/example.css'); $this->Html->script('/dist/example.js');

更多推荐

本文发布于:2023-07-22 09:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219137.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   文件夹   名称   如何在   目录中

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!