Answer the question
In order to leave comments, you need to log in
How to upload images in yii2 using vova07\imperavi\Widget?
According to the documentation, inserted into the view
<?=$form->field($model, 'text')->label('Текст статьи')->widget(Widget::className(), [
'settings' => [
'lang' => 'ru',
'minHeight' => 300,
'imageUpload' => Url::to(['/mycontrollername/image-upload']),
'plugins' => [
'imageupload',
'imagemanager',
'filemanager',
'fontcolor',
'fullscreen',
]
]
])->textArea(['value' => $post->text])?>
public function actions()
{
return [
'image-upload' => [
'class' => 'vova07\imperavi\actions\UploadAction',
'url' => 'http://yii.loc/public/images/', // URL адрес папки где хранятся изображения.
'path' => '@webroot/public/images', // Или абсолютный путь к папке с изображениями.
],
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question