Getting Tinymce to work in CakePHP was really easy.
All you need to do is download Tinymce and place the folder tiny_mce into app/js/ and add the following into your view
echo $javascript->link('tiny_mce/tiny_mce.js', false);
?>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
convert_urls : false,
theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
});
</script>
Doing that will get you the following textarea in your view

Just a note that if you’ve downloaded the jquery version of Tinymce, remember to also include the jquery javascript in your view as so:
echo $javascript->link('jquery-1.3.2.min', false);
echo $javascript->link('tiny_mce/tiny_mce.js', false);
... ...
Leave a Reply