PHP code example of larcool / ckeditor

1. Go to this page and download the library: Download larcool/ckeditor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

larcool / ckeditor example snippets



    'ckeditor' => [
    		
    		    //Set to false if you want to disable this extension
    		    'enable' => true,
    		
    		    // Editor configuration
    		    'config' => [
    			   "simpleUpload"=>[
    			   	    "uploadUrl"=>'/admin/uploads'
    			   ],
    			    "fontSize" => [
    			    	"options" =>[
    					    9,
    					    11,
    					    13,
    					    'default',
    					    17,
    					    19,
    					    21
    				    ]
    			    ],
    			    "toolbar"=>[
    			    	"items"=>[
    					    'heading',
    					    'fontFamily',
    					    'fontSize',
    					    'fontColor',
    					    'fontBackgroundColor',
    					    'bold',
    					    'italic',
    					    'link',
    					    'bulletedList',
    					    'numberedList',
    					    '|',
    					    'indent',
    					    'outdent',
    					    '|',
    					    'imageUpload',
    					    'blockQuote',
    					    'insertTable',
    					    'mediaEmbed',
    					    'undo',
    					    'redo'
    				    ]
    			    ],
    			    'image'=>[
    			    	'toolbar'=>['imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight'],
    				    'resizeUnit'=>'px',
    				    'styles'=>[
    					    // This option is equal to a situation where no style is applied.
    					    'full',
    					
    					    'side',
    					    // This represents an image aligned to the left.
    					    'alignLeft',
    					    'alignCenter',
    					    // This represents an image aligned to the right.
    					    'alignRight'
    				    ]
    			    ],
    			    
    			    "table" =>[
    			    	'contentToolbar'=>[
    					    'tableColumn',
    					    'tableRow',
    					    'mergeTableCells'
    				    ]
    			    ],
    			    'language'=>'zh-cn',
    		    
    		    ]
    	    ]


Form::extend('editor', \larcool\CKEditor\Editor::class);
bash
php artisan vendor:publish --tag=larcool-ckeditor