Wednesday, June 1, 2016

How to Add a CkEditor in Laravel Project?

laravel ckeditor



Many of you have asked how can I add a CKEditor in my Laravel Project. So Here is the Very simple solution for that. Let's start.
About CKeditor:

CKEditor (in the past FCKeditor) is an open source WYSIWYG word processor intended to convey basic word processor includes specifically to website pages, disentangling their substance creation. Its center code is composed in JavaScript.

1. First in your view page such as index.blade.php write the textarea where you want to show the CKEditor or form for taking input. Make sure you keep an Id in it so that we can catch it with JavaScript Code:

<textarea id="article-ckeditor" class="form-control" name="description" rows="3"></textarea>

2. Now use the below JavaScript code for catching that Id "article-ckeditor" before the closing tag.

<script src="//cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>

 <script>
      CKEDITOR.replace( 'article-ckeditor' ); 
 </script> 

 3. That's it. So if you load the page you will see the CKEditor will appear Instantly in your web page.

That's it for today. Hope you Like the article. Make Sure you Share it.


Related Articles

0 comments:

Post a Comment