2017 © Pedro Peláez
 

library summernotebundle

This bundle provides a WYSIWYG editor form type based on summernote

image

solilokiam/summernotebundle

This bundle provides a WYSIWYG editor form type based on summernote

  • Wednesday, October 14, 2015
  • by solilokiam
  • Repository
  • 2 Watchers
  • 2 Stars
  • 701 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

SummernoteBundle

What is SummernoteBundle?

Summernotebundle integrates SummerNote WYSIWYG Editor into Symfony form type., (*1)

Status

Build Status SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Requirements

Minimum requirements for this bundle are: - Symfony 2.3 - Twitter's Bootstrap 3.0 - jQuery 1.9, (*3)

Installation

Add SummernoteBundle to your application's composer.json file, (*4)

{
    "require": {
        "solilokiam/summernotebundle": "dev-master"
    }
}

Add SummernoteBundle to your application's AppKernel.php file, (*5)

new Solilokiam\SummernoteBundle\SolilokiamSummernoteBundle()

Add Routing information to your application's routing.yml:, (*6)

solilokiam_summernote_bundle:
    resource: "@SolilokiamSummernoteBundle/Resources/config/routing.xml"
    prefix: /summernote

Minimal Configuration

You must determine which object manager are you using. Currently it only supports Doctrine ODM, and doctrine ORM., (*7)

app/config/config.yml, (*8)

solilokiam_summernote:
    db_driver: mongodb #supported orm,mongodb for odm

You must also tell which class is going to inherit the bundle asset class., (*9)

solilokiam_summernote:
    asset_class: Acme\DemoBundle\Document\Asset

An example for the asset class can be like this (doctrine odm):, (*10)

<?php

namespace Acme\DemoBundle\Document;


use Solilokiam\SummernoteBundle\Model\SummernoteAsset;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/**
 * Class Asset
 * @package Acme\DemoBundle\Document
 * @MongoDB\Document(collection="assets")
 */
class Asset extends SummernoteAsset
{
    /**
     * @MongoDB\Id(strategy="auto")
     */
    protected $id;

    ...
}

Additional Configuration

Summernote supports some configuration parameters. This parameters can configured application wide in config.yml., (*11)

  • width: This is the width of summernote widget
solilokiam_summernote:
   ...
   width: 500
  • focus: Autofocus the widget.
 solilokiam_summernote:
    ...
    focus: true
  • toolbar: Configure toolbars of the widget.Every line in toolbar config is a different button group. You can check available buttons at summernote documentation
  solilokiam_summernote:
    ...
    toolbar:
        - { name: style, buttons: ['bold', 'italic', 'underline', 'clear'] }
        - { name: paragraph, buttons: ['ul', 'ol', 'paragraph']}

Usage

Summernote bundle provides a formtype. This example form uses it:, (*12)

class TestFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        ...
        $builder->add('test_text', 'summernote');
        ...

    }
    ...

}

You need also to add some twig tags in your templates to import all CSS and JS needed to make summernote work:, (*13)

...
{% block stylesheets %}
    {{ summernote_form_stylesheet(form) }}
{% endblock %}

{% block javascripts %}
    {{ summernote_form_javascript(form) }}
{% endblock %}

The Versions

14/10 2015

dev-master

9999999-dev

This bundle provides a WYSIWYG editor form type based on summernote

  Sources   Download

MIT

The Requires

 

The Development Requires

by Miquel Company Rodriguez

30/10 2014

dev-fix-issue-11

dev-fix-issue-11

This bundle provides a WYSIWYG editor form type based on summernote

  Sources   Download

MIT

The Requires

 

The Development Requires

by Miquel Company Rodriguez

20/05 2014

0.1

0.1.0.0

This bundle provides a WYSIWYG editor form type based on summernote

  Sources   Download

MIT

The Requires

 

The Development Requires

by Miquel Company Rodriguez