This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I've been stuck at this for about two days now. I'm currently writing a plugin, following the docs as closely as possible. However... When I tried to open my create/update pages, I get the error:
"Form behavior has not been initialized, check that you have called initForm() in your controller."
I have included Backend.Behaviors.FormController in the controller. I have also included the formConfig variable. I have a correctly formatted yaml file and a create.htm similar to the one in the docs. I tried everything. Followed the instructions from the docs exactly, but still getting the error. What could I be doing wrong? Thanks in advance.
Last updated
Try this in your controller:
public function index()
{
$this->getClassExtension('Backend.Behaviors.FormController')->index();
}
Tried that, results in this error:
Call to undefined method Backend\Behaviors\FormController::index()
Controller code: http://laravel.io/bin/zXrDD
Form config yaml: http://laravel.io/bin/qYE36
Fields yaml (not complete yet): http://laravel.io/bin/78eDr
Last updated
Tried actually calling this in your controller like the error message suggests?
$this-> initForm();
Found the culprit. Apparently, Sublime text was automatically adding 'tabs' to my yaml files when I jumped to a new line, thus causing a corrupt file. The formRender method simply couldn't read the yaml file and threw an error, because it wasn't receiving anything from the model and therefore thought initForm hadn't been called.
Last updated
1-10 of 10