咔咔咔 2014-02-14 10:18:19 5906次浏览 4条评论 0 0 0

第一种方法:
//ueditor在视图里添加:_form.php

//getId添加表名大写加字段名
<?php
$this->widget('ext.ueditor.Ueditor',
    array(
        'getId'=>'Visa_visa_sxcl',//model名字_加字段名
        'UEDITOR_HOME_URL'=>"/",
        'options'=>'toolbars:[["fontfamily","fontsize","forecolor","bold","italic","strikethrough","|","insertunorderedlist","insertorderedlist","blockquote","|","link","unlink","highlightcode","|","undo","redo","source"]],
            wordCount:false,
            elementPathEnabled:false,
            imagePath:"",
            initialContent:"",
            ',
));
?>

ueditor下载地址:http://url.cn/RQkMK7

放到protected/extensions下

第二种方法:
//editor在视图里添加:_form.php

    <div class="row">
    <?php echo $form->labelEx($model,'visa_tbts'); ?>
    <?php 
    $this->widget('application.extensions.editor.CKkceditor',array(
        "model"=>$model,                      # Data-Model
        "attribute"=>'visa_tbts',          # Attribute in the Data-Model
        "height"=>'200px',
        "width"=>'800px',
        "filespath"=>Yii::app()->basePath."/../up/",
        "filesurl"=>Yii::app()->baseUrl."/up/",
    ));
    ?>
    <?php echo $form->error($model,'visa_tbts'); ?>
</div>

editor下载地址:http://url.cn/QlEyEj

放到protected/extensions下

您需要登录后才可以评论。登录 | 立即注册