CKEditor v.4 in CodeIgniter 2 project [closed]
Okay this really isn't hard at all...
Put this in the head of the page you want the ckEditor in, obviously pointing to the correct path for your application:
<script src="'.base_url().'assets/lib/ckeditor/ckeditor.js"></script>
Then in the body where you want the editor:
<textarea cols="80" id="editorName" name="editorName" rows="60"></textarea>
At the bottom of the page:
<script type="text/javascript"> CKEDITOR.replace( 'editorName' );</script>
It's honestly that easy.
using codeigniter & Ckeditor 4.02 based on code from the ck example page
<script src="<?php echo base_url();?>ckeditor/ckeditor.js"></script> <?php // static example to populate form with text $formvalue = "Here is some text to appear in the form box. " ; ?> <textarea class="ckeditor" name="editor1"><?php echo $formvalue ?></textarea>
You can also use the CI form helper
<?php $formvalue = "Here is some text to appear in the form box." ; $formdata = array( 'class' => 'ckeditor', 'name' => 'editor1', 'id' => 'SomeID', 'value' => $formvalue ); echo form_textarea($formdata) ; ?>
Next step would be replacing $formvalue with a database result to populate the form (like editing a blog post, etc). And if you use the CI Form helper it needs to be loaded first, the easiest is to autoload it in config/autoload.php
Now -- If some brilliant person has some tips on creating a custom tool bar...?