ns/simplemde-bundle

This bundle provides the simplemde markdown editor and forms to a symfony bundle

Installs: 7 168

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 5

Open Issues: 3

Type:symfony-bundle

1.0.5 2020-04-13 15:50 UTC

This package is auto-updated.

Last update: 2024-04-14 00:59:41 UTC


README

This bundle provides the simplemde markdown editor

Installation

Add the bundle to your composer.json file:

require: {
    // ...
    "ns/simplemde-bundle": "dev-master" // or use a tag from packagist.org
    // ...
}

Register the bundle with your kernel:

<?php
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new NS\SimpleMDEBundle\NSSimpleMDEBundle(),
    // ...
);

Add the JS and CSS links to relevant pages

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" type="text/css" id="'+ssId+'" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css" crossorigin="anonymous" />
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript" id="'+jsId+'" src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js" crossorigin="anonymous"></script>
{% endblock %}

Then you can use it as a form type with MarkdownEditorType::class type hint.