This bundle provides a EpicEditor integration for your Symfony2 Project. It simply adds the form field type epiceditor
to the Form Component.
For more information about EpicEditor see: http://oscargodson.github.com/EpicEditor/
- Add BackenderEpiceditorBundle to your composer.json
- Enable the bundle
- Install bundle assets
- Configure the bundle (optional)
- Add the editor to a form
{
"require": {
"Backender/epiceditor-bundle": "*"
}
}
Update your project dependencies:
php composer.phar update Backender/epiceditor-bundle
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Backender\EpiceditorBundle\BackenderEpiceditorBundle(),
);
}
$ php ./app/console assets:install web --symlink
--symlink is optional
For a full configuration dump use:
$ php ./app/console config:dump-reference BackenderEpiceditorBundle
An example configuration:
backender_epiceditor:
class: Backender\EpiceditorBundle\Form\Type\EpiceditorType
container: epiceditor
basepath: /web/bundles/backenderepiceditor
clientSideStorage: true
localStorageName: epiceditor
parser: marked
focusOnLoad: false
file:
name: epiceditor
defaultContent:
autoSave: 100
theme:
base: /themes/base/epiceditor.css
preview: /themes/preview/github.css
editor: /themes/editor/epic-dark.css
shortcut:
modifier: 18
fullscreen: 70
preview: 80
edit: 79
Or even overwrite the configuration within a FormBuilder (see Step 5).
Example form:
<?php
$form = $this->createFormBuilder($post)
->add('content', 'epiceditor', array(
'container' => 'epiceditor',
'basepath' => '/~marc/blog/web/bundles/backenderepiceditor',
'clientSideStorage' => true,
'localStorageName' => 'epiceditor',
'parser' => 'marked',
'focusOnLoad' => false,
'file' => array(
'name' => 'epiceditor',
'defaultContent' => '',
'autoSave' => 100
),
'theme' => array(
'base' => '/themes/base/epiceditor.css',
'preview' => '/themes/preview/github.css',
'editor' => '/themes/editor/epic-dark.css'
),
'shortcut' => array(
'modifier' => 18,
'fullscreen' => 70,
'preview' => 80,
'edit' => 79
)
))
->getForm()
;
Note: All parameters from config.yml can be overwritten in a form (excluding class
).
##Contribute
If the bundle doesn't allow you to customize an option, I invite you to fork the project, create a feature branch, and send a pull request.
To ensure a consistent code base, you should make sure the code follows the Coding Standards.
##License
This bundle is under the MIT license. See the complete license here.
- Testing is coming soon