This bundle extends https://github.com/stfalcon/TinymceBundle so https://github.com/stfalcon/TinymceBundle/blob/master/README.md must be readed first
Add bundle as a dependency to the composer.json of your application
"require": {
...
"gwinn/tinymce-fastload-bundle": "2.0.0"
...
},
Add the custom repository
"repositories": [
{
"type": "package",
"package": {
"name": "tielitz/tinymce-fastload-bundle",
"version": "2.0.0",
"source": {
"url": "https://github.com/tielitz/TinymceFastloadBundle.git",
"type": "git",
"reference": "2.0.0"
},
"autoload": {
"psr-4": {
"Gwinn\\TinymceFastloadBundle\\": ""
}
}
}
}
]
// app/AppKernel.php
<?php
// ...
public function registerBundles()
{
$bundles = array(
...
new Gwinn\TinymceFastloadBundle\GwinnTinymceFastloadBundle(),
);
}
Similar to tinymce-bundle, just add to assetic & stfalcon_tinymce & gwinn_tinymce_fastload 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 | ..."
...
gwinn_tinymce_fastload:
upload_path: '%tinymce.upload_path%'
url_path: '%tinymce.url_path%'
Add path to upload folder
tinymce.upload_path: '%kernel.root_dir%/../web/uploads/images/'
tinymce.url_path: '/uploads/images/
Add bundle routes
tinymce_fastload_uploader:
resource: "@GwinnTinymceFastloadBundle/Resources/config/routing.yml"
prefix: /
{% 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 %}
{% block javascripts %}
{% javascripts output='js/compiled/tinymce-image-upload.js' '@GwinnTinymceFastloadBundle/Resources/public/js/tinymce-image-upload.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
php app/console assets:install web/