Home Ask Login Register

Developers Planet

Your answer is one click away!

Chirag February 2016

CKEditor not displaying data in CakePHP

I am using CKEditor plugin in CakePHP like this :

$this->element('ckeditor', array(
       'name' => 'body', 
       'id' => 'description', 
       'width' => 628, 
       'height' => 250

But I am unable to see the content on page load. $instructionDetails['Instruction']['body'] contains html data. I tried static data also and its displaying in it but not html data. On changing language I am able to see the content since I am using:


in the JavaScript change event. Is there way to use setData in $this->element('ckeditor') with other params?


valar morghulis February 2016

You need to tell ckeditor to open in which default mode. The mode to load at the editor startup depends on the plugins loaded. By default, the "wysiwyg" and "source" modes are available.

Use This

CKEDITOR.config.startupMode = 'source'

CKEDITOR.instances.config.startupMode = 'source'

What it will is open the data as source to you.

Post Status

Asked in February 2016
Viewed 3,473 times
Voted 4
Answered 1 times


Leave an answer

Quote of the day: live life