X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_samples%2Fphp%2Fstandalone.php;h=586e0c8ed1a076140c04cbc3bf79435434d355f5;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=2a39ca1662814882261814f7976f4ef0a9cc439a;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_samples/php/standalone.php b/_samples/php/standalone.php index 2a39ca1..586e0c8 100644 --- a/_samples/php/standalone.php +++ b/_samples/php/standalone.php @@ -1,18 +1,40 @@ - Sample - CKEditor + Creating CKEditor Instances — CKEditor Sample -

- 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. +

+
- -
- Output -
-

-
-

-

- This is some sample text.

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

-
-
+ +
+

+ +

+

+ 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); + ?> + +

+