I'm new to October CMS and learning to create a Form Widget. But I'm getting the following error :
The partial '_field_actorbox.htm' is not found.
/opt/lampp/htdocs/octobermovies/modules/system/traits/ViewMaker.php line 65
My widget folder name is 'formwidgets' My partials file name inside partials folder is '_widget.htm' Content of my formwidgets > Actorbox.php
namespace Watchlearn\Movies\FormWidgets;
use Backend\Classes\FormWidgetBase;
use Config;
class ActorBox extends FormWidgetBase
{
public function widgetDetails()
{
return [
'name' => 'Actorbox',
'description' => 'Field for adding actors'
];
}
public function render(){
return $this->makePartial('widget');
}
public function loadAssets()
{
$this->addCss('css/select2.css');
$this->addJs('js/select2.js');
}
}
My code to register the widget in plugin.php
public function registerFormWidgets()
{
return [
'Watchlearn\Movies\FormWidgets\ActorBox' => [
'label' => 'ActorBox Field',
'code' => 'actorbox'
]
];
}
I tried to find and looked into the documentation also but could not find any solution for this.
The Actorbox.php should be in the formwidgets path. If properly created the dir structure would be like
|-- formwidgets
|
|-- ActorBox.php
| `-- actorbox
| |-- assets
| | |-- css
| | | |-- actorbox.css
| | | `-- select2.min.css
| | `-- js
| | |-- actorbox.js
| | `-- select2.min.js
| `-- partials
| `-- _actorbox.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With