sizannia / editor-bundle
Symfony EditorBundle
Installs: 164
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- doctrine/doctrine-bundle: *
- symfony/framework-bundle: >=2.1
- twig/twig: *
This package is not auto-updated.
Last update: 2017-10-27 08:24:50 UTC
README
#Sizannia Editor
Installation
Require the bundle in your composer.json file:
{ "require": { "sizannia/editor-bundle": "1.*", } }
Install the bundle:
$ php composer.phar update
Add Sizannia Editor bundle to your AppKernel.php file:
<?php public function registerBundles() { $bundles = array( ... new Sizannia\EditorBundle\SizanniaEditorBundle(), ... ); }
Configuration
layout.html.twig
Put in the javascript block, the following lines:
{% include "SizanniaEditorBundle:Layout:sizannia.html.twig" with {'lang': lang }%}
With "lang" the language of your website
routing.yml
sizannia_editor: resource: "@SizanniaEditorBundle/Resources/config/routing.xml"
Usage
This configuration is an example. You can use this bundle without include this configuration
config.yml
sizannia_editor: plugins: # You can add your custom plugin wenzgmap: enable: false | true path: "bundles/acmedemo/plugins/wenzgmap/" filename: "plugin.js" youtube: enable: false | true path: "bundles/acmedemo/plugins/youtube/" filename: "plugin.js" # CKFinder is a file explorer. You can include an image in a text ckfinder: true | false #You can change the display of the toolbar. This configuration is common to all editors toolbars: - { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates', '/' ] } - { name: 'document', items: ['/'] } # New Line - { name: 'default', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] } - { name: 'default2', items: [ 'Bold', 'Italic' ] } # You can remove one or many plugins removePlugins: about, find, save, templates, dialogadvtab, div, forms, newpage, bidi, flash, table, tabletools, pagebreak, maximize, showblocks, preview, print # If you want you can add style for html element styles: - {name: "Titre Paragraphe", element: 'p', attributes: {'class': 'paragraph-title'}} - {name: "Titre Contact / SavoirPlus", element: 'p', attributes: {'class': 'encart-title'}} - {name: "Titre Saviez-Vous", element: 'p', attributes: {'class': 'saviez-title'}} - {name: "SousTitre Saviez-Vous", element: 'p', attributes: {'class': 'saviz-undertitle'}} - {name: "Titre Pack Accueil Lieu", element: 'span', attributes: {'class': 'lieu'}} - {name: "Titre Pack Accueil Fr?quence", element: 'span', attributes: {'class': 'frequence'}} - {name: "Titre Pack Accueil Aller", element: 'span', attributes: {'class': 'amplitude-aller'}} - {name: "Titre Pack Accueil Retour", element: 'span', attributes: {'class': 'amplitude-retour'}} - {name: "Titre Contact", element: 'span', attributes: {'class': 'title-contact'}} - {name: "SousTitre Contact", element: 'span', attributes: {'class': 'sous_title-contact'}} - {name: "Lien Site Contact", element: 'span', attributes: {'class': 'website-contact'}} - {name: "Lien Mail Contact", element: 'span', attributes: {'class': 'mail-contact'}}
Form
In this example, optional, you can change the composition of the toolbar, depending eg user rights
$this->createFormBuilder($task) ->add('description', "sizannia_editor_type", array( 'config' => array( 'toolbar' => array( array( 'name' => 'document', 'items' => array('Source', 'Save', 'NewPage', 'DocProps', 'Preview', 'Print', '-', 'Templates'), ), '/', array( 'name' => 'basicstyles', 'items' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'), ) ) ) ) )