How to add FCKeditor in Symfony

March 10, 2010

1. Download sfWidgetFormTextareaFCKEditor.class.php.docx and save the code inside the doc as sfWidgetFormTextareaFCKEditor.class.php put this file to {Your Project Name}/lib folder.
2. Download FCKEditor (from fckeditor.net) and unpack it to {Your Project Name}/web/js/fckeditor
3. In the “configure()” method of your form class, configure the fields where you want to use FCKEditor:

$this->widgetSchema[‘address’] = new sfWidgetFormTextareaFCKEditor(
array(
‘width’ => 750,
‘height’ => 350,
‘tool’ => ‘Default’, // name of a configured toolbar
‘config’=> ‘fckeditor/fckconfig.js’ // points to web/js/myfckconfig.js
));

4. You can customize the configuration for FCKEditor, found in {Your Project Name}/web/js/ fckeditor/fckconfig.js

Advertisements