nitrado/code-mirror-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

This Bundle integrates CodeMirror editor into a Symfony2 project.

Installs: 6 212

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 18

Language:JavaScript

Type:symfony-bundle

dev-master 2016-02-24 21:24 UTC

This package is not auto-updated.

Last update: 2022-06-11 04:10:29 UTC


README

Integration CodeMirror editor in you symfony2 project.

###Install

Just add the following line to your projects composer.json require section, and update vendors:

"nitrado/code-mirror-bundle": "dev-master"

Enable bundle , add to AppKernel.php:

 new Solution\CodeMirrorBundle\SolutionCodeMirrorBundle()

###Configuration Add default parameters to config.yml:

twig:
    form:
        resources:
            - 'SolutionCodeMirrorBundle:Form:code_mirror_widget.html.twig'

assetic:
    bundles:
        - # ... other bundles
        - SolutionCodeMirrorBundle

solution_code_mirror:
    parameters:
        mode: text/html
        lineNumbers: true
        lineWrapping: true
        theme: base16-dark
    mode_dirs:
        - @SolutionCodeMirrorBundle/Resources/public/js/mode
    themes_dirs:
        - @SolutionCodeMirrorBundle/Resources/public/css/theme

Install assets:

$ ./app/console assets:install web --symlink

###Usage

 $builder->add('content', 'code_mirror', array(
    'required' => true,
    'parameters' => array(
         'lineNumbers' => 'true'
     )
 ));