X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_samples%2Fphp%2Fstandalone.php;h=cb8d2dee49cc458ab920a70409b243d8ba082a04;hp=2a39ca1662814882261814f7976f4ef0a9cc439a;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hpb=9afde8772159bd3436f1f5b7862960307710ae5a diff --git a/_samples/php/standalone.php b/_samples/php/standalone.php index 2a39ca1..cb8d2de 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); + ?> + +

+