Skip to content

Commit 387a2cd

Browse files
authored
addRemoveButton accepts Nette\Utils\Html (#87)
1 parent b89d552 commit 387a2cd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Buttons/RemoveButton.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Contributte\FormMultiplier\Multiplier;
66
use Nette\Forms\Controls\SubmitButton;
77
use Nette\SmartObject;
8+
use Nette\Utils\Html;
89

910
final class RemoveButton
1011
{
@@ -14,12 +15,12 @@ final class RemoveButton
1415
/** @var callable[] */
1516
public array $onCreate = [];
1617

17-
private ?string $caption = null;
18+
private Html|string|null $caption = null;
1819

1920
/** @var string[] */
2021
private array $classes = [];
2122

22-
public function __construct(?string $caption)
23+
public function __construct(Html|string|null $caption)
2324
{
2425
$this->caption = $caption;
2526
}

src/Multiplier.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Nette\Forms\Form;
1414
use Nette\Utils\ArrayHash;
1515
use Nette\Utils\Arrays;
16+
use Nette\Utils\Html;
1617
use Traversable;
1718

1819
class Multiplier extends Container
@@ -153,7 +154,7 @@ public function getCopyNumber(): int
153154
return $this->copyNumber;
154155
}
155156

156-
public function addRemoveButton(?string $caption = null): RemoveButton
157+
public function addRemoveButton(Html|string|null $caption = null): RemoveButton
157158
{
158159
return $this->removeButton = new RemoveButton($caption);
159160
}

0 commit comments

Comments
 (0)