Enterprise System Developer

Integration CKEditor and CKFinder with CakePHP 2.x

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someonePrint this page

Editor in website is so important to make the content more beautiful, so we will see how integration CKEditor and CKFinder with cakephp 2.x.

CKEditor

Creating editor helper:

EditorHelper.php
<?php
class EditorHelper extends Helper
{
 function loadCK($id){
 $buff = "<script type=\"text/javascript\">
 //<![CDATA[
 var editor_$id = CKEDITOR.replace('$id', {customConfig : '/js/editor/config_".LANG.".js'});
 CKFinder.SetupCKEditor( editor_$id, '/js/ckfinder/' );
 //]]>
 </script>";
 return $buff;
 }
}
?>

Second will call it controller :

<?php
    public $helpers = array('Editor');
?>

 

Third we will creating the view :

form.ctp
<script src="/js/editor/ckeditor.js" type="text/javascript"></script>
<script src="/js/ckfinder/ckfinder.js" type="text/javascript"></script>
<?php echo $this->Form->textarea('Item.content', array('size' => '32')); ?>
<?php echo $this->Editor->loadCK ('PagetextContent');  ?>

 

And After download ckeditor and ckfinder from source http://ckeditor.com and we will put them in /webroot/js/ folder.

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someonePrint this page

10 Responses

  1. WilliamJax says:

    The strategies stated in this article on the topic of to increase traffic at you own webpage are actually good, thanks for such good post.
    Legendario.

  2. BobbuBrowne says:

    Hello! Cool post, amazing!!!

  3. navigate to these guys says:

    I have been browsing online more than 3 hours today,
    yet I never found any interesting article like yours.

    It is pretty worth enough for me. Personally, if all site owners and bloggers made good
    content as you did, the internet will be much more useful
    than ever before.

  4. Clemmie says:

    Awesome article.

  5. penisvergrößerung möglich says:

    I am truly thankful to the holder of this website who has shared this wonderful piece of writing at at this place.

  6. Florene says:

    I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m still new to the whole thing.

    I’d really appreciate it.

  7. tour rest says:

    Greetings! Very helpful advice in this particular article!
    It’s the little changes that produce the most important changes.

    Many thanks for sharing!

  8. penisvergrößerung hamburg says:

    Thank you for some other informative web site. The place else could I get that kind of
    information written in such a perfect method? I have a venture that I am simply now running on, and I have been at the glance out for
    such information.

  9. penisverlängerung says:

    This is a topic that’s near to my heart… Thank you! Where are your contact details though?

  10. Raptors says:

    I am in fact happy to read this webpage posts which contains tons of useful facts,
    thanks for providing these kinds of information.

Comments

Your email address will not be published. Required fields are marked *