Source for file standalone.php

Documentation is available at standalone.php

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!--
  3. Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.html or http://ckeditor.com/license
  5. -->
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8.     <title>Creating CKEditor Instances &mdash; CKEditor Sample</title>
  9.     <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  10.     <link href="../sample.css" rel="stylesheet" type="text/css"/>
  11. </head>
  12. <body>
  13.     <h1 class="samples">
  14.         CKEditor Sample &mdash; Creating CKEditor Instances
  15.     </h1>
  16.     <div class="description">
  17.     <p>
  18.         This sample shows how to create a CKEditor instance with PHP.
  19.     </p>
  20.     <pre class="samples">
  21. &lt;?php
  22. include_once "ckeditor/ckeditor.php";
  23.  
  24. // Create a class instance.
  25. $CKEditor = new CKEditor();
  26.  
  27. // Path to the CKEditor directory.
  28. $CKEditor->basePath = '/ckeditor/';
  29.  
  30. // Create a textarea element and attach CKEditor to it.
  31. $CKEditor->editor("textarea_id", "This is some sample text");
  32. ?&gt;</pre>
  33.     <p>
  34.         Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> and <code>name</code> attribute of
  35.         the <code>&lt;textarea&gt;</code> element that will be created.
  36.     </p>
  37.     </div>
  38.     <!-- This <div> holds alert messages to be display in the sample page. -->
  39.     <div id="alerts">
  40.         <noscript>
  41.             <p>
  42.                 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
  43.                 support, like yours, you should still see the contents (HTML data) and you should
  44.                 be able to edit it normally, without a rich editor interface.
  45.             </p>
  46.         </noscript>
  47.     </div>
  48.     <!-- This <fieldset> holds the HTML code that you will usually find in your pages. -->
  49.     <form action="../sample_posteddata.php" method="post">
  50.         <p>
  51.             <label for="editor1">
  52.                 Editor 1:</label>
  53.         </p>
  54.         <p>
  55.         <?php
  56.             // Include the CKEditor class.
  57.             include_once "../../ckeditor.php";
  58.             // The initial value to be displayed in the editor.
  59.             $initialValue '<p>This is some <strong>sample text</strong>.</p>';
  60.             // Create a class instance.
  61.             $CKEditor new CKEditor();
  62.             // Path to the CKEditor directory, ideally use an absolute path instead of a relative dir.
  63.             //   $CKEditor->basePath = '/ckeditor/'
  64.             // If not set, CKEditor will try to detect the correct path.
  65.             $CKEditor->basePath '../../';
  66.             // Create a textarea element and attach CKEditor to it.
  67.             $CKEditor->editor("editor1"$initialValue);
  68.         ?>
  69.             <input type="submit" value="Submit"/>
  70.         </p>
  71.     </form>
  72.     <div id="footer">
  73.         <hr />
  74.         <p>
  75.             CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  76.         </p>
  77.         <p id="copy">
  78.             Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  79.             Knabben. All rights reserved.
  80.         </p>
  81.     </div>
  82. </body>
  83. </html>