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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -