1. Go to this page and download the library: Download reazzon/editor 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/ */
reazzon / editor example snippets
public function getContentHtmlAttribute()
{
return \ReaZzon\Editor\Classes\JSONConverter::convertAndGetHTML($this->content);
}
namespace Acme\Foo\Tools;
use ReaZzon\Editor\Classes\Tool;
class ExampleTool extends Tool
{
public function registerSettings(): array
{
return [
'class' => 'Example'
];
}
public function registerValidations(): array
{
return [
'value' => [
'type' => 'string'
]
];
}
public function registerScripts(): array
{
return [
'/acme/foo/assets/js/exampleTool.js'
];
}
public function registerView(): ?string
{
return 'acme.foo::blocks.example';
}
}
/**
* registerEditorJsBlocks extension blocks for EditorJs
*/
public function registerEditorJsTools(): array
{
return [
\Acme\Foo\Tools\ExampleTool::class => 'example',
];
}
bash
php artisan plugin:install ReaZzon.Editor
bash
php artisan create:plugin Acme.Foo
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.