@1alexandr

Как подключить elfinder и tinymce в symfony2?

Здравствуйте, подскажите пожалуйста где я делаю ошибку. Я пытаюсь подключить Eldinder и Tinymce для редактирования и загрузки изображений при создании статей.
Вот ArticleType
class ArticleType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name', 'text')
                ->add('text', 'textarea', ['attr' => ['class' => 'tinymce', 'data-theme' => 'advanced']])
                ->add('save', 'submit');
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'App\MainBundle\Entity\Article',
        ));
    }

    public function getName()
    {
        return 'article_form';
    }

}


Config.yml
stfalcon_tinymce:
    include_jquery: false
    tinymce_jquery: false
    use_callback_tinymce_init: false
    selector: .tinymce
    base_url: ~
    language: ru
    theme:
        # Simple theme: same as default theme
        simple: ~
        # Advanced theme with almost all enabled plugins
        advanced:
             plugins:
                 - "advlist autolink lists link image charmap print preview hr anchor pagebreak"
                 - "searchreplace wordcount visualblocks visualchars code fullscreen"
                 - "insertdatetime media nonbreaking save table contextmenu directionality"
                 - "emoticons template paste textcolor"
             toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview code media | forecolor backcolor emoticons | stfalcon | example"
             image_advtab: true
             file_browser_callback: 'elFinderBrowser'
             height: 300
             valid_elements: '*[*]'
             valid_children: '+body[style],+style[#text]'
             extended_valid_elements: 'style[*]'
             invalid_elements: ''
             verify_html: false
             convert_urls: false
        # BBCode tag compatible theme (see http://www.bbcode.org/reference.php)
        bbcode:
             plugins: ["bbcode, code, link, preview"]
             menubar: false
             toolbar1: "bold,italic,underline,undo,redo,link,unlink,removeformat,cleanup,code,preview"
    external_plugins: ~

# FMElfinder Configuration
fm_elfinder:
    locale: %locale% # defaults to current request locale
    editor: tinymce4 # other choices are tinymce or simple
    fullscreen: true # defaults true, applies to simple and ckeditor editors
    include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
    compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
    connector:
        debug: false # defaults to false
        roots:       # at least one root must be defined
            uploads:
                driver: LocalFileSystem
                path: uploads
                upload_allow: ['all'] #['image/png', 'image/jpg', 'image/jpeg', '']
                upload_deny:  [''] #['all']
                upload_max_size: 5M


Но редактор все равно не появляется.
  • Вопрос задан
  • 914 просмотров
Решения вопроса 1
@jaxel
Ресурсы от бандла установлены?
php app/console assets:install --symlink

В шаблоне подключены?
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы