<textarea cols="80" id="editor2" name="editor2" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea> </p> <p> <input type="submit" value="Submit"/> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> <?php // Include the CKEditor class. include "../../ckeditor.php"; // 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 = '../../'; // Replace all textarea elements with CKEditor. $CKEditor->replaceAll(); ?> </body> </html>
function ckeditor_replace($class = 'ck_editor') { $ckeditor = new CKEditor(Config::get('ckeditor.basepath')); return $ckeditor->replaceAll($class); }