solution/code-mirror-bundle

此包将 CodeMirror 编辑器集成到 Symfony2 项目中。

安装: 747

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 2

分支: 18

开放问题: 1

语言:JavaScript

类型:symfony-bundle

dev-master 2013-06-03 14:18 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:48:57 UTC


README

包尚未准备就绪。

在您的 symfony2 项目中集成 CodeMirror 编辑器。

###安装

只需将以下行添加到项目的 composer.json 的 require 部分,并更新 vendors

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

启用包,添加到 AppKernel.php

 new Solution\CodeMirrorBundle\SolutionCodeMirrorBundle()

###配置

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

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

安装资源

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

###使用

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