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

imageUpload #66

Closed
AmadouD opened this issue Feb 16, 2016 · 4 comments
Closed

imageUpload #66

AmadouD opened this issue Feb 16, 2016 · 4 comments

Comments

@AmadouD
Copy link

AmadouD commented Feb 16, 2016

what do you mean about default controller; i have to create a new controller under the extention
or i have to put this
public function actions()
{
return [
'image-upload' => [
'class' => 'vova07\imperavi\actions\UploadAction',
'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
'path' => '@alias/to/my/path' // Or absolute path to directory where files are stored.
],
];
}
to my form controller .
i tried the second one but giving me # url unknow
please give somme explanation about uploading file and image;
sorry for my bad english

@vova07
Copy link
Owner

vova07 commented Feb 16, 2016

Hi @AmadouD ,
You have put that code to your existing controller class.
The problem with url can have some relation with routing settings. Maybe you forgot to add a rule to your UrlManager configs for that new upload action.

@AmadouD
Copy link
Author

AmadouD commented Feb 16, 2016

Hi @vova07 thank for your reponse its help me a lot !!
i have setup the configs in url manager but still didnt get the icon for image

he is my ofrresController
` public function actions()
{

  return [
      'image-upload' => [
        'class' => 'vova07\imperavi\actions\UploadAction',
        'url' => Yii::$app->getUrlManager()->getBaseUrl().'/uploads/', // Directory URL address, where files are stored.
        'path' => Yii::$app->basePath.'/common/uploads/' // Or absolute path to directory where files are stored.

    ],
  ];

}`

and my _form
<?= $form->field($model, 'description')->widget(Widget::className(), [ 'settings' => [ 'lang' => 'fr', 'minHeight' => 200, 'plugins' => [ 'fontfamily', 'clips', 'fullscreen', 'imageUpload' => Url::to(['/offres/image-upload']) ] ] ]); ?>
note : i have already fix the problem with url.
any idea what i am missing; i am new in advanced template

@vova07
Copy link
Owner

vova07 commented Feb 17, 2016

Not sure if that is a typo or not, but the problem I see is that 'imageUpload' option must be a key of 'settings' array not 'plugins'. Try to fix that to see the result. Sorry for missed exemple, writing from smartphone.

@AmadouD
Copy link
Author

AmadouD commented Feb 17, 2016

after putting the Url::to(['/offres/image-upload']) outside the plugins
and put imagemanager, filemanager in plugings it work fine
thank you a lot;
great extensions i will put a star

@AmadouD AmadouD closed this as completed Feb 17, 2016
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