当我包含 jquery 的插件时出现问题,图像不可见。该图像包含在一个 css 文件中。
div{background-image:url('famfamfam.png');background-repeat:no-
repeat;width:16px;height:16px}
我尝试的例子。代码放置在
/webroot/protected/components/MyWidjet.php
在一个方法中
在里面()
$cs = Yii::app()->clientScript;
$cs->registerCssFile(Yii::app()->assetManager->publish(dirname(__FILE__).'/css/
editor.css'));
$cs->registerPackage(Yii::app()->assetManager->publish(dirname(__DIR__).'/vendor/
minified/'));
$cs->registerCssFile(Yii::app()->assetManager->publish(dirname(__DIR__) .
'/vendor/minified/themes/default.min.css'));
$cs->registerScriptFile(Yii::app()->assetManager->publish(dirname(__DIR__) .
'/vendor/minified/jquery.sceditor.bbcode.min.js'));
echo CHtml::script("$(function() {
$('textarea').sceditor({
plugins: 'bbcode',
toolbar:
'bold,italic,horizontalrule,underline,strike,subscript,superscript|left,center,right,\
justify|size,color|bulletlist,orderedlist|table|
code,quote,image,link,unlink|maximize,source',
locale: 'ru',
charset: 'utf-8',
autofocus: true,
enablePasteFiltering: true,
spellcheck: true,
style: 'minified/jquery.sceditor.default.min.css'
});
});");
访问权限为 777