Answer the question
In order to leave comments, you need to log in
How to add imagemanager to vova07/yii2-imperavi-widget?
I added the imagemanager
line to plugins[] and added it to the action, but there is still no image button. I did everything as it says in the documentation .
_form.php
<?
echo $form->field($model, 'body')->widget(Widget::className(), [
'settings' => [
'lang' => 'ru',
'toolbar' => true,
'minHeight' => 200,
'imageManagerJson' => Url::to(['/default/images-get']),
'plugins' => [
'table',
'fontsize',
'fontcolor',
'fontfamily',
'imagemanager',
'fullscreen',
]
]
]);
?>
public function actionCreate()
{
$model = new Page();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
'images-get' => [
'class' => 'vova07\imperavi\actions\GetAction',
'url' => Yii::$app->getRequest()->getHostInfo() . '/upload/images/', // URL адрес папки где хранятся изображения.
'type' => GetAction::TYPE_IMAGES,
]
]);
}
}
Answer the question
In order to leave comments, you need to log in
I did everything as it says in the documentation.
'images-get' => [
'class' => 'vova07\imperavi\actions\GetAction',
'url' => Yii::$app->getRequest()->getHostInfo() . '/upload/images/',
'path' => '@upload/images',
'type' => GetAction::TYPE_IMAGES,
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question