gwinn/tinymce-fastload-bundle

This Bundle integrates in TinyMCE WYSIWYG editor fast images upload

Installs: 467

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 0

Type:symfony-bundle

dev-master / 1.0.x-dev 2014-07-23 05:02 UTC

This package is auto-updated.

Last update: 2024-11-08 10:07:41 UTC


README

This bundle extends https://github.com/stfalcon/TinymceBundle so https://github.com/stfalcon/TinymceBundle/blob/master/README.md must be readed first

Installation

Add bundle as a dependency to the composer.json of your application

    "require": {
        ...
        "gwinn/tinymce-fastload-bundle": "dev-master"
        ...
    },

Add bundle to your application kernel.

// app/AppKernel.php
<?php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Gwinn\TinymceFastloadBundle\GwinnTinymceFastloadBundle(),
        );
    }

Configuration

config.yml

Similar to tinymce-bundle, just add to assetic & stfalcon_tinymce section in config.yml

assetic:
    ...
    bundles:
        - GwinnTinymceFastloadBundle
    ...

stfalcon_tinymce:
    ...
    tinymce_buttons:
        image_uploader:
        title: "Upload Image"
        image: "asset[bundles/gwinntinymcefastload/images/upload.png]"
    ...
    theme:
        simple:
            toolbar: "... | image_uploader | ..."

parameters.yml

Add path to upload folder

    tinymce-fastload-savepath: "%kernel.root_dir%/../web/files/"

routing.yml

Add bundle routes

    tinymce_fastload_uploader:
        resource: "@GwinnTinymceFastloadBundle/Resources/config/routing.yml"
        prefix:   /

Include in template

{% extends '::base.html.twig' %}

{% block body %}
    <form action="path('lab_basic_homepage')" method="post">
        <div>
            <textarea class="tinymce" name="simple-text"></textarea>
        </div>
    </form>

    {{ tinymce_init() }}
    {% include 'GwinnTinymceFastloadBundle:Uploader:tinymce_file_uploader.html.twig' %}

{% endblock %}

{% block stylesheets %}
    {% stylesheets filter='cssrewrite' output='css/compiled/style.css' 'bundles/gwinntinymcefastload/css/*' %}
        <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

Copy resources to web folder

    php app/console assets:install web/