1

I am using HMVC codeigniter 3.1.3. And i am trying to integrate CKEditor to my project. To do so I followed a tutorial from here and here(from stackoverflow). I tried saving both "CKEditor" and "CKFinder" library files in library folder of project i.e. "project_name/libraries" and folder where admin controllers works i.e. "project_name/modules/admin/libraries" and helper file in "project_name/helpers". And also everything is working fine but one thing that is "toolbar" is not showing up where textarea starts. here's my code for view file:

<div class="form-input-box" id="content_field_box">
            <!-- <input id="field-content" class="form-control" name="content" type="text" value="<?php echo $data->content?>" maxlength="200">-->
            <?php echo $this->ckeditor->editor("content","field-content","$data->content"); ?>
</div>

and code for controller from where view file is called:

public function __construct()
    {
        parent::__construct();
        $this->load->library('form_builder');
        $this->load->model('privacy_policy_model');
        $this->load->library('common_library');
        $this->load->library('ckeditor');
        $this->load->library('ckfinder');
        $this->load->helper('ckeditor_helper');
        $this->ckeditor->basePath = base_url().'asset/ckeditor/';
        $this->ckeditor->config['toolbar'] = array(
                        array( 'Source', '-', 'Bold', 'Italic', 'Underline', '-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo','-','NumberedList','BulletedList' )
                                                            );
        $this->ckeditor->config['language'] = 'it';
        $this->ckeditor->config['width'] = '730px';
        $this->ckeditor->config['height'] = '300px';            

        //Add Ckfinder to Ckeditor
        $this->ckfinder->SetupCKEditor($this->ckeditor, base_url().'asset/ckfinder/'); 
    }

and here's the image of things working:

ss of working things

so what changes i need to do, so that toolbar should appear correctly ?

Anshul Joshi
  • 55
  • 1
  • 7

0 Answers0