nitrado / code-mirror-bundle
此包已被废弃,不再维护。未建议替代包。
此包将CodeMirror编辑器集成到Symfony2项目中。
dev-master
2016-02-24 21:24 UTC
Requires
- php: >=5.3.2
- symfony/assetic-bundle: *
- symfony/symfony: ~2.3|~3.0
- twig/twig: *
- zendframework/zend-json: 2.0.*
This package is not auto-updated.
Last update: 2022-06-11 04:10:29 UTC
README
将CodeMirror编辑器集成到您的symfony2项目中。
###安装
只需将以下行添加到项目的composer.json的require部分,并更新vendor
"nitrado/code-mirror-bundle": "dev-master"
启用包,添加到AppKernel.php
new Solution\CodeMirrorBundle\SolutionCodeMirrorBundle()
###配置 在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
安装资源
$ ./app/console assets:install web --symlink
###使用
$builder->add('content', 'code_mirror', array( 'required' => true, 'parameters' => array( 'lineNumbers' => 'true' ) ));