我有一个datetimepicker
带有 assets 文件夹的组件js
,css
并且img
不为空:
application/components
application/components/datetimepicker/assets
application/components/datetimepicker/assets/js
application/components/datetimepicker/assets/css
application/components/datetimepicker/assets/img
我尝试assets
通过一次调用publish
方法来发布整个文件夹yii
Asset Manager
:
$assetsPath = Yii::getPathOfAlias('datetimepicker.assets');
$assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, true);
但它不发布任何东西。文件夹下的所有文件夹和文件application/
都有读写权限。有人可以帮忙吗?
PS我确保Yii::getPathOfAlias('datetimepicker.assets')
返回正确的路径并Yii::app()->assetManager->publish($assetsPath, false, -1, true)
返回合理的字符串 - /assets/d4a0c9d8
。还将yii
整个application/components/datetimepicker/assets/
目录复制到application/assets
名称d4a0c9d8
-下application/assets/d4a0c9d8
,但在 html 输出文件中生成指向此文件夹中文件的链接。