PHP code example of flexible-ux / lexical-bundle

1. Go to this page and download the library: Download flexible-ux/lexical-bundle 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/ */

    

flexible-ux / lexical-bundle example snippets


// config/bundles.php
return [
    // ...
    FlexibleUx\FlexibleUxLexicalBundle::class => ['all' => true],
];

use FlexibleUx\Form\Type\LexicalFormType;

$builder->add('description', LexicalFormType::class);

$builder->add('description', LexicalFormType::class, [
    'label'   => 'Description',
    ' '320px',
]);

'toolbar' => ['bold', 'italic', '|', 'link', 'unlink'],   // two groups
'toolbar' => ['bold', 'italic', 'link'],                  // no separators at all

'toolbar' => ['bold', 'italic', '|', 'bullet', 'number', '|', 'link', 'unlink'],   // no alignment
'toolbar' => ['bold', '|', 'align-center'],   // or cherry-pick a single alignment button

$builder->add('description', LexicalFormType::class, [
    'allowed_link_schemes' => ['https'], // https-only links
]);