Closed mprof closed 2 years ago
What is the namespace of the TextInput you inherit from? Since if you are using https://github.com/nextras/form-components/blob/master/src/Fragments/UIControl/TextInput.php you shouldn't use traits.
What is the namespace of the TextInput you inherit from? Since if you are using https://github.com/nextras/form-components/blob/master/src/Fragments/UIControl/TextInput.php you shouldn't use traits.
Namespace of inherited TextInput is: Nette\Forms\Controls (like in your solution)
I am trying to reproduce your solution posobota-2014-server-validation in actual version of Nette, so everything is almost same, but when use BaseControlTrait, described error occurs.
well, that's 8 years old. things changed since then. you may take a look at https://github.com/nextras/form-components/blob/master/src/Controls/AutocompleteControl.php how to inherit from text field.
When using Nextras\FormComponents\Fragments\Traits\BaseControlTrait in my class representing live form server validation, then occours error with method getControl() (origin in BaseControlTrait):
TypeError: Nette\Forms\Helpers::exportRules(): Argument #1 ($rules) must be of type Nette\Forms\Rules, null given
Seems like $this->rules variable is empty, when using this trait.