Skip to content

Commit

Permalink
skip the warning trigger that component is not intended to be used in…
Browse files Browse the repository at this point in the history
… the Presenter
  • Loading branch information
hrach committed Nov 4, 2024
1 parent c4603eb commit b508495
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Fragments/UIComponent/BaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@
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;


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);
}
}
9 changes: 9 additions & 0 deletions src/Fragments/UIControl/BaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit b508495

Please sign in to comment.