N
N
niceandriyanov2018-10-26 18:41:04
Yii
niceandriyanov, 2018-10-26 18:41:04

Yii2 lots of tinymce image loading. How?

I create two tinyMce fields

echo $form->field($model, "text")->label('Описание')
    ->widget(TinyMce::className(), [
        'options' => ['rows' => 10,'value' => ''],
        'clientOptions' => [
            'plugins' => [
                "advlist autolink lists link charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste",
                "image imagetools spellchecker visualchars textcolor",
                "autosave colorpicker hr nonbreaking responsivefilemanager filemanager"
            ],
            'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
            'external_filemanager_path' => '/plugins/responsivefilemanager/filemanager/',
            'filemanager_title' => 'Open Filemanager',
            'external_plugins' => [
                'filemanager' => "/plugins/responsivefilemanager/filemanager/plugin.min.js",
                "responsivefilemanager" => "/plugins/responsivefilemanager/filemanager/plugin.min.js"
            ],
            'relative_urls' => false,
        ]
    ]);

    echo $form->field($model, "mission")->label('Миссия компании')
        ->widget(TinyMce::className(), [
            'options' => ['rows' => 10,'value' => ''],
            'clientOptions' => [
                'plugins' => [
                    "advlist autolink lists link charmap print preview anchor",
                    "searchreplace visualblocks code fullscreen",
                    "insertdatetime media table contextmenu paste",
                    "image imagetools spellchecker visualchars textcolor",
                    "autosave colorpicker hr nonbreaking responsivefilemanager filemanager"
                ],
                'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
                'external_filemanager_path' => '/plugins/responsivefilemanager/filemanager/',
                'filemanager_title' => 'Responsive Filemanager',
                'external_plugins' => [
                    'filemanager' => "/plugins/responsivefilemanager/filemanager/plugin.min.js",
                    "responsivefilemanager" => "/plugins/responsivefilemanager/filemanager/plugin.min.js"
                ],
                'relative_urls' => false,
            ]
        ]);

And so loading of the image only in one, in the last is possible. Moreover, all IDs are different, initialization is inserted into different IDs. It doesn't work (please help..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question