Answer the question
In order to leave comments, you need to log in
How to add image upload to plugin https://github.com/TarasKrava/OctoberCMS-comments-plugin OctoberCMS?
I wanted to add image loading to the plugin comments https://github.com/TarasKrava/OctoberCMS-comments-... OctoberCMS. I tried to add by analogy with watch-learn.com/video-tutorials/making-websites-oc... In the Builder constructor, I added a field to the base for the image url, In SaurabhDhariwal\Comments\Models\Comments.php I added
public $ to the main class attachOne = [
'commentimage' => 'System\Models\File'
];
to the model
$model->commentimage = Input::file('commentimage');
And to the component
...
To fields:
commentimage:
label: 'Add image'
mode: image
useCaption: true
thumbOptions:
mode: crop
extension: auto
span: auto
type: fileupload
Forgot something. Writes
Model 'SaurabhDhariwal\Comments\Models\Comments' does not contain a definition for 'commentimage'
/home/mamont/baker/modules/backend/traits/FormModelWidget.php line 82
Help if you want...
Answer the question
In order to leave comments, you need to log in
Good afternoon. OctoberCMS Russian community has a special convenient forum: https://octoclub.ru
You can try to ask a question there)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question