cakephp $this->html->css,CakePHP - how to link html css helper to a different folder

博主正在探讨如何在CakePHP项目中将CSS文件从css目录移到js目录下,以便于管理和配合js库。他们目前使用$this->Html->css()来加载样式,现在想改变这个助手函数指向js目录。问题在于询问是否这样做是最佳实践,或者是否有更好的方法来组织文件结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Currently I'm using using this to load in css in my CakePHP project.

echo $this->Html->css('jquery-ui',null,array('inline' => false));

That is assuming that I'm putting my css file in a css folder.

However, I'm now thinking about moving my css that is needed for js libraries to the js folder instead. (i.e in js/lib/jquery-ui.js AND js/lib/jquery-ui.css). That way I don't have to keep track of 2 folders with the same structure.

How can I change where CakePHP's css helper to point to a different folder?

Or is that not a good practice what I'm trying to do. (i.e moving the plugin css to live in the same folder as the js)

Thanks,

Tee

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值