简体   繁体   English

Yii :: app()-> clientScript-> registerCssFile不起作用吗?

[英]Yii::app()->clientScript->registerCssFile not working YII?

I have put these lines in my testLayout.php in views/layouts. 我已经将这些行放在view / layouts的testLayout.php中。 I also put some jquery in yii\\framework\\web\\js\\source to resolve conflicts(as they were creating conflict) and create jquery entry in packages.php file. 我也将一些jquery放在yii \\ framework \\ web \\ js \\ source中,以解决冲突(因为它们正在创建冲突)并在packages.php文件中创建jquery条目。

It is working very perfect on my local machine (window 7). 在我的本地计算机上(窗口7),它运行得非常完美。 (can see script registration in view page source) (可以在查看页面源代码中查看脚本注册)

Yii::app()->clientScript->registerCoreScript('custom');
Yii::app()->clientScript->registerCoreScript('foundationmin');
Yii::app()->clientScript->registerCoreScript('app')

Yii::app()->clientScript->registerCoreScript('phoneIcs');
Yii::app()->clientScript->registerCoreScript('phoneMask');

But when I uploaded my project to linux server and give permission #777 to assets folder. 但是,当我将项目上传到linux服务器并为资产文件夹赋予#777权限时。 The CSS and jquery are not working.When I look it in page source ,I did not find any script register line. CSS和jquery无法正常工作。当我在页面源代码中查看它时,没有找到任何脚本注册行。

I dont know What might be the problem.? 我不知道可能是什么问题。

Linux和Windows操作系统的路径分隔符有所不同:“ /”代表* nix,“ \\”代表win,请在配置中检查coreScripts路径的斜杠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM