Answer the question
In order to leave comments, you need to log in
YII2. How to write the path correctly?
Installed the widget - asofter/yii2-imperavi-redactor .
Image loading problem.
Installed advanced template.
For the test, I created an upload folder in the root. Registered alias in common/config/bootstrap.php:
Yii::setAlias('@upload', dirname(dirname(__DIR__)) . '/upload');
<?php echo $form->field($model, 'body_en')->widget(
\yii\imperavi\Widget::className(),
[
'plugins' => ['fullscreen', 'fontcolor', 'video'],
'options'=>[
'minHeight'=>400,
'maxHeight'=>400,
'buttonSource'=>true,
'imageUpload'=>Yii::$app->urlManager->createUrl([Yii::getAlias('@upload')])
]
]
) ?>
<?php echo $form->field($model, 'body_en')->widget(
\yii\imperavi\Widget::className(),
[
'plugins' => ['fullscreen', 'fontcolor', 'video'],
'options'=>[
'minHeight'=>400,
'maxHeight'=>400,
'buttonSource'=>true,
'imageUpload'=>Yii::getAlias('@upload')
]
]
) ?>
Answer the question
In order to leave comments, you need to log in
There was a similar problem. Install https://github.com/vova07/yii2-imperavi-widget. The package already has ready-made GetAction and UploadAction. Just set the paths for loading images correctly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question