TC
Twill CMS16mo ago
zlem

Radio button with formbuilder -> Class "App\Http\Controllers\Twill\Option" not found

Hi, I'm trying to add a radio field in Twill 3 formbuider, as described on https://twillcms.com/docs/form-fields/radios.html But I'm facing an "Class "App\Http\Controllers\Twill\Option" not found" error Whats wrong, could not find any hints in the docs
Twill
5 Replies
luciano.mizra
luciano.mizra16mo ago
You should import the class with "use A17\Twill\Services\Forms\Option;" at the beginning of your file. You should do this with every class you use.
zlem
zlemOP16mo ago
@luciano.mizra I already imported "use A17\Twill\Services\Forms\Option;" - but its not working
luciano.mizra
luciano.mizra16mo ago
You missed "Options" in plural, there are 2 different classes. If you are using Visual Studio, it should highlight in red the classes that you didn't import.
luciano.mizra
luciano.mizra16mo ago
Another thing, do not use multiple "$form->add"; you should use "addFieldset" instead: https://twillcms.com/docs/modules/form-builder.html#content-fieldsets
Twill
zlem
zlemOP16mo ago
@luciano.mizra awesome - thank you so much!!
Want results from more Discord servers?
Add your server