2013-02-01 5 views
0

Yii Newbie here, 이전에 CKEditor TextArea 내부에서 만든 뷰를 렌더링하려면 어쨌든 궁금합니다.Yii : CKEditor 텍스트 영역 내에서의 렌더링

값 속성 내부에서 렌더링을 시도했지만 불행히도 작동하지 않았습니다.

이렇게 할 방법이 있습니까? 또는 별도의 함수를 만들고 페이지를 텍스트 영역으로 출력해야합니까?

팁, 조언 또는 조언을 크게 듣습니다 !! 당신이 modelattribute 속성을 지정하면 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', 
    )); ?> 
+0

는 –

답변

1

감사드립니다. 따라서 CKeditor 내부에 무언가를 표시하려면 위젯을 렌더링하기 전에 $model->body="Your content goes here"으로 지정해야합니다. 귀하의 경우에는 CKEditor 내부에서보기를 렌더링해야합니다. 따라서 CController::render() 함수를 세 번째 매개 변수와 true로 사용하십시오. 즉

<?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', 
    )); ?> 
+0

너무 감사합니다이 게시물 http://www.yiiframework.com/forum/index.php/topic/9341-ckeditor-widget-in-a-cactiveform/를 참조하십시오! – KayKay