How to setup FCKeditor

3 1
5
Viewed: 40 023 times
Version: Unknown (update)
Category: Tutorials
    Written by: krillzip krillzip
    Updated by: Dark-Sun Dark-Sun
    Created: Feb 8, 2009
    Updated: 14 years ago

    You are viewing revision #2 of this wiki article.
    This version may not be up to date with the latest version.
    You may want to view the differences to the latest version or see the changes made in this revision.

    « previous (#1)next (#3) »

    To start with you need to download the latest stable release of FCKeditor. Extract the downloaded file and place the fckeditor/ folder in your applications webroot directory.

    Next to do is to download the Yii FCKeditor extension, created by Ascomae. Extract the downloaded file, and place the fckeditor/ widget folder in your web applications protected/extensions/ directory.

    Configuring the FCKeditorWidget ΒΆ

    In the view where you want to use the FCKeditorWidget:

    <?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
                'model'     =>  $model,
                'attribute' => 'Text',
                'height'    =>  '400px',
                'width'     =>  '100%',
                'fckeditor' =>  dirname(Yii::app()->basePath).'/fckeditor/fckeditor.php',
                'fckBasePath' => Yii::app()->baseUrl.'/fckeditor/')
    ); ?>
    
    • the model property is the instance of the Model to be associated with.
    • attribute the Model attribute to be associated with.
    • fckeditor, the path to the fckeditor php file.
    • fckBasePath, the url to the editor frontend to be loaded inside the iframe.

    If those instructions have been followed exactly the FCKeditor should work correctly.