PHP code example of peresmishnyk / backpack-summernote

1. Go to this page and download the library: Download peresmishnyk/backpack-summernote 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/ */

    

peresmishnyk / backpack-summernote example snippets


$this->crud->addField([
    'name' => 'article',
    'label' => 'Article body',
    'type' => 'summernote',
    'view_namespace' => 'peresmishnyk.backpack-summernote::fields',
]);

HTMLCleaner::clear($value);

    public static function boot()
    {
        parent::boot();

        // Setup event bindings...
        News::saving(function (News $news) {
            // Use custom rules
            $rules = 'video,source,strong,b,u,i,br,p[class],span[class|style],a[href|target],h1,h2,h3,h4,h5,h6,img[src|style|width|height|data-filename],hr,code,blockquote,ul,ol,li,iframe,font[color],table,tr,td,th,thead,colgroup,col,tfoot,tbody,strike,sup,sub';
            $news->body = HTMLCleaner::clear($news->body, rules);
        });
    }