X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/256592bf803e851aa7fc953e08a6e9e58d970f8c..871bad8291b6dbc29d489d95d185458caab25158:/skins/ckeditor/_samples/php/events.php diff --git a/skins/ckeditor/_samples/php/events.php b/skins/ckeditor/_samples/php/events.php new file mode 100644 index 0000000..a625192 --- /dev/null +++ b/skins/ckeditor/_samples/php/events.php @@ -0,0 +1,153 @@ + + + +
++ This sample shows how to add event handlers to CKEditor with PHP. +
++ A snippet of the configuration code can be seen below; check the source code of this page for + the full definition: +
+<?php +// Include the CKEditor class. +include("ckeditor/ckeditor.php"); + +// Create a class instance. +$CKEditor = new CKEditor(); + +// Path to the CKEditor directory. +$CKEditor->basePath = '/ckeditor/'; + +// The initial value to be displayed in the editor. +$initialValue = 'This is some sample text.'; + +// Add event handler, instanceReady is fired when editor is loaded. +$CKEditor->addEventHandler('instanceReady', 'function (evt) { + alert("Loaded editor: " + evt.editor.name); +}'); + +// Create an editor instance. +$CKEditor->editor("editor1", $initialValue); ++