X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_samples%2Fphp%2Freplace.php;h=36f877bc6c2379b4accc01656434c779c881505b;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hp=80d813bda8e1f50a68aeb81a7fcf45dcd3ea0fb9;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_samples/php/replace.php b/_samples/php/replace.php index 80d813b..36f877b 100644 --- a/_samples/php/replace.php +++ b/_samples/php/replace.php @@ -1,18 +1,46 @@
-
+ This sample shows how to replace a selected <textarea>
element
+ with a CKEditor instance by using PHP code.
+
+ To replace a <textarea>
element, place the following call at any point
+ after the <textarea>
element:
+
+<?php +// Include the CKEditor class. +include_once "ckeditor/ckeditor.php"; + +// Create a class instance. +$CKEditor = new CKEditor(); + +// Path to the CKEditor directory. +$CKEditor->basePath = '/ckeditor/'; + +// Replace a textarea element with an id (or name) of "textarea_id". +$CKEditor->replace("textarea_id"); +?>+
+ Note that textarea_id
in the code above is the id
attribute of
+ the <textarea>
element to be replaced.
+