X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/256592bf803e851aa7fc953e08a6e9e58d970f8c..871bad8291b6dbc29d489d95d185458caab25158:/skins/ckeditor/_samples/php/standalone.php diff --git a/skins/ckeditor/_samples/php/standalone.php b/skins/ckeditor/_samples/php/standalone.php new file mode 100644 index 0000000..cb8d2de --- /dev/null +++ b/skins/ckeditor/_samples/php/standalone.php @@ -0,0 +1,83 @@ + + + + + Creating CKEditor Instances — CKEditor Sample + + + + +

+ CKEditor Sample — Creating CKEditor Instances +

+
+

+ This sample shows how to create a CKEditor instance with PHP. +

+
+<?php
+include_once "ckeditor/ckeditor.php";
+
+// Create a class instance.
+$CKEditor = new CKEditor();
+
+// Path to the CKEditor directory.
+$CKEditor->basePath = '/ckeditor/';
+
+// Create a textarea element and attach CKEditor to it.
+$CKEditor->editor("textarea_id", "This is some sample text");
+?>
+

+ Note that textarea_id in the code above is the id and name attribute of + the <textarea> element that will be created. +

+
+ +
+ +
+ +
+

+ +

+

+ This is some sample text.

'; + // Create a class instance. + $CKEditor = new CKEditor(); + // Path to the CKEditor directory, ideally use an absolute path instead of a relative dir. + // $CKEditor->basePath = '/ckeditor/' + // If not set, CKEditor will try to detect the correct path. + $CKEditor->basePath = '../../'; + // Create a textarea element and attach CKEditor to it. + $CKEditor->editor("editor1", $initialValue); + ?> + +

+
+ + +