I am using CKEditor plugin in CakePHP like this :
$this->element('ckeditor', array(
'name' => 'body',
'description'=>$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:
CKEDITOR.instances.description.setData(data);
in the JavaScript change event. Is there way to use setData
in $this->element('ckeditor')
with other params?
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.