Using TinyMCE with CakePHP
It’s finally my deadline. Oh well, I am not really a blogger so I just hope you’ll stick with my article. Please bear with my “work of art”. Duh?!?
Ok, let’s get this started. As the title says, my article is all about TinyMCE + Cakephp. This may not be too challenging or may appear newly baked for others but for me, it’s something worth writing for. There’s just a few blocks of information that I need to discuss and everything we’ll be done in a short while.
TinyMCE is a WYSIWYG editor by Moxiecode which is downloadable for free. It has been integrated with some of the fast-rising CMS in the OS community nowadays. Such would be joomla and drupal. Here, integrating is so easy, so just follow these steps and good luck:
- Download tinyMCE.
- Once downloaded, unpack TinyMCE, and copy just the
tinymce/jscripts/tiny_mcefolder in/webroot/js. - Then follows the configuration. To make this thing work on cakephp, simple do these:
- First, add the code below to the layout(s) that will be used on the page(s) that will have the editor.
- Add the javascript helper to your $helpers array in your controller(s)
- Then, for each page that you would want the TinyMCE editor to show, just add to the top of the view file this code below:
- First, add the code below to the layout(s) that will be used on the page(s) that will have the editor.
Source: Bakery
Tags: tinymce

June 26th, 2008 at 9:05 am
in 1.2, you can use the javascript->codeBlock() method to add these and in the view you just add a parameter false to it so it gets added via the scripts_for_layout.
…and thanks for the concise guide. Have you tried v3 TinyMCe with this? Im jsut using 2 but wodnered if it still works?
June 26th, 2008 at 10:26 am
thanks for the correction. There are really a lot of improvements for 1.2. I’ll try to include your suggestion in the post.
I am currently using the version 3 right now. It works but there is an minor error seen in firebug. I haven’t taken a serious look at it since it still works.