使用Yii框架注册客户端包时使用https而不是http


Using https instead of http when registering a client package using Yii framework

我只使用https进行登录操作,所以当我们发布无效密码时,它会刷新页面并出现验证错误,在这种情况下,https会阻止所有css、js。。以http开头的资源。

BTW我正在使用Yii客户端软件包注册:

  Yii::app()->clientScript->registerPackage('login');

在这里登录是一个资产包:

  'login' => array(
    'js'  => array('js/jquery.js', 'js/bootstrap.js', 'js/other.js'),
    'css' => array('css/other.css'),
    'depends'  => array('jquery'),
    'basePath' => 'theme'
   ),

因此,例如,css文件将bock并选择要破坏的页面的样式。

有办法吗?

您可能需要研究设置包的basePath属性。更多详细信息请点击此处:http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-详细