PHP code example of waynestate / nova-ckeditor4-field
1. Go to this page and download the library: Download waynestate/nova-ckeditor4-field 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/ */
waynestate / nova-ckeditor4-field example snippets
namespace App\Nova;
use Waynestate\Nova\CKEditor4Field\CKEditor;
class Article extends Resource
{
// ...
public function fields(Request $request)
{
return [
// ...
CKEditor::make('Body', 'body');
// ...
];
}
}
/*
|--------------------------------------------------------------------------------
| CKEditor Options
|--------------------------------------------------------------------------------
|
| To view a list of all available options checkout the CKEditor API documentation
| https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
|
*/
'options' => [
'toolbar' => [
['Source','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Image','Table','HorizontalRule','SpecialChar','PageBreak'],
'/',
['Bold','Italic','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight'],
['Link','Unlink','Anchor'],
'/',
['Format','FontSize'],
['Maximize', 'ShowBlocks','-','About']
]
],