2

I'm new to Yii framework, I need an FCK editor for my CMS management page. I downloaded and extracted the FCKeditor to the root folder and its extension in yii extension folder. and i added the following code in my view

<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array( "model"=>$model, # Data-Model "attribute"=>'content', # Attribute in the Data-Model "height"=>'400px', "width"=>'100%', "toolbarSet"=>'Basic', # EXISTING(!) Toolbar (see: fckeditor.js) "fckeditor"=>Yii::app()->basePath."/../fckeditor/fckeditor.php", # Path to fckeditor.php "fckBasePath"=>Yii::app()->baseUrl."/fckeditor/", # Realtive Path to the Editor (from Web-Root) "config" => array( "EditorAreaCSS"=>Yii::app()->baseUrl.'/css/index.css',), # http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options # Additional Parameter (Can't configure a Toolbar dynamicly) ) ); ?> 

These all are working fine. but the editor is displayed separatly. i need the editor in place of content textarea.enter image description here

1
  • 3
    everytime i see FCK editor I think it says something else... Commented May 8, 2012 at 5:49

1 Answer 1

1
<?php echo CHtml::activeTextArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> 

To use FCKEditor instead of the above textarea, invoke the integration widget by replacing above code with following:

<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array( 'model' => $model, 'attribute' => 'content', 'height' => '600px', 'width' => '100%', 'fckeditor' => dirname(Yii::app()->basePath).'/htdocs/fckeditor/fckeditor.php', 'fckBasePath' => Yii::app()->baseUrl.'/fckeditor/') ); ?> 

If you did it in this way, then the textarea will be replaced with editor.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah that works... thanks Sudhir. Me followed the jquery model replacement, thats y the repetion.. thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.