X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_samples%2Fphp%2Fevents.php;h=de09c5680cf4d401385687f1376a92a6b9c5901b;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=36f2be27644d3e39bfcd768f3e94c2a98b2b7cc4;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_samples/php/events.php b/_samples/php/events.php index 36f2be2..de09c56 100644 --- a/_samples/php/events.php +++ b/_samples/php/events.php @@ -1,18 +1,48 @@
-+ 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); ++
+ +
+