PHP Classes

TinyMCE Fastload Bundle: Upload images to be displayed in WYSIWYG editor

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 359 All time: 6,925 This week: 87Up
Version License PHP version Categories
tinymce-fastload 1.0.0MIT/X Consortium ...5.3.0PHP 5, Graphics, Files and Folders, C...
Description 

Author

This package can upload images to be displayed in WYSIWYG editor.

It extends the TinyMCE Symfony bundle by adding an image upload button.

The image is upload imedidately using an AJAX request, so it can be used right after the upload to be inserted in a TinyMCE WYSIWYG editor.

Picture of Alex Lushpai
  Performance   Level  
Innovation award
Innovation award
Nominee: 2x

 

Documentation

TinymceFastloadBundle

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/

  Files folder image Files (13)  
File Role Description
Files folder imageController (1 file)
Files folder imageDependencyInjection (2 files)
Files folder imageResources (4 directories)
Plain text file composer.json Data Auxiliary data
Plain text file GwinnTinymceFastloadBundle.php Class Class source
Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:359
This week:0
All time:6,925
This week:87Up