Personal tools
You are here: Home Symfony Add TinyMCE to a Symfony project
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Add TinyMCE to a Symfony project

by Pierre-Yves Landuré last modified 2010-03-13 15:03

TinyMCE is a inline Wysiwyg HTML editor that is very well integrated with Symfony. Still, you need to download third party sources if you want to use it. This article help you through this process.

Note : This article need you to install the unzip tool. For Debian and Ubuntu, you can install it with apt-get :

/usr/bin/sudo /usr/bin/apt-get install unzip

Installing TinyMCE

First, configure the emplacement of the root of you Symfony project :


Choose also the application you want to use TinyMCE with :


Configure the TinyMCE version you want to use :


We remove the dots from the TinyMCE version :


We download TinyMCE sources :

/usr/bin/wget$ \

We unzip the downloaded file :

/usr/bin/unzip -o /tmp/tinymce_$ -d /tmp

If you want, you can also download translations for TinyMCE :

/usr/bin/wget\&product=tinymce \

Unzip the downloaded file in the target directory :

/usr/bin/unzip -o /tmp/ -d /tmp/jscripts/tiny_mce

And move the TinyMCE source folder to the target emplacement in your Symfony project :

/bin/cp -r /tmp/jscripts/tiny_mce/ "$PROJECT_HOME/web/js/"

Now, configure your Symfony project to use TinyMCE :

/bin/sed -i -e '/^  .settings:/a\
rich_text_js_dir: js/tiny_mce' "$PROJECT_HOME/apps/$PROJECT_APP/config/settings.yml"

Warning: Check your settings.yml file to make sure that everything want well :

/usr/bin/vim "$PROJECT_HOME/apps/$PROJECT_APP/config/settings.yml"

You can now remove the downloaded files :

/bin/rm -r /tmp/tinymce
/bin/rm /tmp/
/bin/rm /tmp/tinymce_$

You can now use TinyMCE with PHP codes like :

<?php echo textarea_tag('name', 'default content', 'rich=true size=10x20') ?>
<?php echo textarea_tag('name', 'default content', array(
'rich' => true,
'size' => '10x20',
'tinymce_options' => 'language:"fr",theme_advanced_buttons2:"separator"',
)) ?>


Very useful...

Posted by Blaise at 2008-04-16 16:42
Thanks for sharing this! It works perfectly!

Ridiculously easy...

Posted by Mauro at 2008-05-05 15:19
Great job Pierre.
I've blindly followed your steps and it worked like a charm.

Thank you so much!!

In Thanks section...

Posted by Nicolas Dubois <> at 2008-05-07 15:37
... you definitely have to thank yourself for this awesome script!

admin genarator - formatting not getting saved

Posted by Naga Gangadhar Reddy at 2008-11-24 15:23
used the same to see the tinymce but.......formatting is not getting saved...used object_textarea_tag rather textarea_tag

TinyMCE in ajax form

Posted by Pierre-Yves Landuré at 2008-11-25 08:21
You are probably using TinyMCE in a ajax saved form. I've a page in french that has the solution to this problem:

You can try to translate it using google,or search the web for tinymce, symfony and ajax.

Thank you very much.

Posted by zhuozi at 2009-01-08 07:14
Thank you for your help.

It might be simpler

Posted by André Lademann at 2009-03-04 20:42
It might be simpler to use the debian package "tinymce" mit "apt-get install tinymce".
Mybe its not the newest, but it still works!


Posted by ami at 2009-12-22 03:56
i have some problem in use tiny MCE

result like this
" <p>dasar- dasar drupal</p> <p>hal - hal yang harus diperhatikan</p> "

but i not want html script view

do u have solution??

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: