PHP code example of clementtalleu / easyadmin-markdown-bundle

1. Go to this page and download the library: Download clementtalleu/easyadmin-markdown-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/ */

    

clementtalleu / easyadmin-markdown-bundle example snippets


// config/bundles.php

return [
    // ...
    ClementTalleu\EasyAdminMarkdownBundle\ClementTalleuEasyAdminMarkdownBundle::class => ['all' => true],
];

use ClementTalleu\EasyAdminMarkdownBundle\Field\MarkdownEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;

class ArticleCrudController extends AbstractCrudController
{
    public function configureFields(string $pageName): iterable
    {
        yield MarkdownEditorField::new('content');
    }
}

MarkdownEditorField::new('content')->setNumOfRows(20);

MarkdownEditorField::new('content')->setEasyMdeConfig([
    'hideIcons' => ['guide', 'fullscreen'],
    'tabSize' => 4,
    'placeholder' => 'Write your story…',
]);

MarkdownEditorField::new('content')->renderAsHtml(false); // always show raw Markdown