Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erron on crop #41

Open
localtux opened this issue Mar 23, 2022 · 1 comment
Open

Erron on crop #41

localtux opened this issue Mar 23, 2022 · 1 comment

Comments

@localtux
Copy link

Hello, I would like to use this tool in Yii2, but unfortunately I get the following error:

Exception 'yii\base\InvalidArgumentException' with message 'Response content must not be an array.'

Appropriate rights in the controller for "upload" have been granted.

My files look like this:

Controller.php
public function actionUpload() { return [ 'uploadPhoto' => [ 'class' => 'budyaga\cropper\actions\UploadAction', 'url' => '/images/news', 'path' => '@frontend/web/images/news', ] ]; }

form.php
<?php echo $form->field($model, 'pictureFile')->widget(Widget::className(), [ 'uploadUrl' => URL::to(['news/upload']), ]) ?>

@mehdi-hashemi-01
Copy link

<?php echo $form->field($model, 'pictureFile')->widget(Widget::className(), [ 'uploadUrl' => Yii::$app->urlManagerBackend->createUrl('uploads'), ]) ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants