diff --git a/src/Fragments/UIComponent/BaseControl.php b/src/Fragments/UIComponent/BaseControl.php index 03e6ae8..6fee41e 100644 --- a/src/Fragments/UIComponent/BaseControl.php +++ b/src/Fragments/UIComponent/BaseControl.php @@ -10,6 +10,8 @@ namespace Nextras\FormComponents\Fragments\UIComponent; use Nette\Application\UI\Component; +use Nette\ComponentModel\Container; +use Nette\ComponentModel\IComponent; use Nette\Forms\Control; use Nextras\FormComponents\Fragments\Traits\BaseControlTrait; @@ -17,4 +19,11 @@ abstract class BaseControl extends Component implements Control { use BaseControlTrait; + + + protected function createComponent(string $name): ?IComponent + { + // skip the warning trigger that component is not intended to be used in the Presenter + return Container::createComponent($name); + } } diff --git a/src/Fragments/UIControl/BaseControl.php b/src/Fragments/UIControl/BaseControl.php index f6aee3f..0c7cab9 100644 --- a/src/Fragments/UIControl/BaseControl.php +++ b/src/Fragments/UIControl/BaseControl.php @@ -10,10 +10,19 @@ namespace Nextras\FormComponents\Fragments\UIControl; use Nette\Application\UI\Control; +use Nette\ComponentModel\Container; +use Nette\ComponentModel\IComponent; use Nextras\FormComponents\Fragments\Traits\BaseControlTrait; abstract class BaseControl extends Control implements \Nette\Forms\Control { use BaseControlTrait; + + + protected function createComponent(string $name): ?IComponent + { + // skip the warning trigger that component is not intended to be used in the Presenter + return Container::createComponent($name); + } }