octobercms plugins - Does not contain a definition for 'file_src' October CMS -


i working @ october cms plugin development, have problem file upload. put fileupload type file_src. when go to resource shows error :

enter image description here

model/resource     fields:         name:             label: name             type: text             required: true         file_src:             label: upload             type: fileupload         grade_id:             label: grade             type: dropdown             emptyoption: select             showsearch: true         subject_id:             label: subject             type: dropdown             emptyoption: select             showsearch: true         type_id:             label: type             type: dropdown             emptyoption: select             showsearch: true 

how can fix error?

i fixed it! must use $attachone or $attachmany relation on model

i added following code in resource.php in models

public $attachone = [     'file_src' => 'system\models\file' ]; 

thats working now!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -