0

ここで Yii 初心者です。以前に CKEditor TextArea 内で作成したビューをレンダリングする方法があるかどうか疑問に思っていました。

value 属性内でレンダリングしてみましたが、残念ながらうまくいきませんでした。

これを行う方法はありますか?または、別の関数を作成して、ページをテキスト領域に出力する必要がありますか?

ヒント、アドバイス、またはポインタは大歓迎です!! ありがとうございました

          <?php
    $this->widget('application.extension.CKEditor.TheCKEditorWidget', array(
        'model' => $model,
        'attribute' => 'body', 
         'value' => //rendered page,    
        'height' => '400px',
        'width' => '800px',
        'toolbarSet' => 'Full',
        'ckeditor' => Yii::app()->basePath . '/../ckeditor/ckeditor.php',
        'ckBasePath' => Yii::app()->baseUrl . '/ckeditor/',
        'css' => Yii::app()->baseUrl . '/css/index.css',
    )); ?>
4

1 に答える 1

1

and属性valueを指定した場合、属性は使用されません。したがって、CKeditor 内に何かを表示するには、ウィジェットをレンダリングする前にそれを指定する必要があります。あなたの場合、CKEditor 内でビューをレンダリングする必要があります。そのため、3 番目のパラメーターを true として関数を使用します。すなわちmodelattribute$model->body="Your content goes here"CController::render()

<?php
    $model->body=$this->render("viewName",array(),true);

    $this->widget('application.extension.CKEditor.TheCKEditorWidget', array(
        'model' => $model,
        'attribute' => 'body',  
        'height' => '400px',
        'width' => '800px',
        'toolbarSet' => 'Full',
        'ckeditor' => Yii::app()->basePath . '/../ckeditor/ckeditor.php',
        'ckBasePath' => Yii::app()->baseUrl . '/ckeditor/',
        'css' => Yii::app()->baseUrl . '/css/index.css',
    )); ?>
于 2013-02-01T18:30:46.127 に答える