Skip to content

Commit

Permalink
Fix AbstractHidden::class. (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 17, 2024
1 parent 6356946 commit 1d40db3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
1 change: 0 additions & 1 deletion docs/form/input/Hidden.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ The following methods are available for setting attributes:
| ------------------ | ----------------------------------------------------------------------------------------------- |
| `attributes()` | Set multiple `attributes` at once. |
| `class()` | Set the `class` attribute. |
| `disabled()` | Set the `disabled` attribute. |
| `id()` | Set the `id` attribute. |
| `name()` | Set the `name` attribute. |
| `style()` | Set the `style` attribute. |
Expand Down
20 changes: 0 additions & 20 deletions src/Input/Base/AbstractHidden.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,21 @@ abstract class AbstractHidden extends Element implements ValueInterface
use HasClass;
use HasId;
use HasName;
use HasPrefixAndSuffix;
use HasStyle;
use HasTemplate;
use HasValue;
use HasWidgetValidation;

protected array $attributes = [];

/**
* This method is used to configure the widget with the provided default definitions.
*/
protected function loadDefaultDefinitions(): array
{
return [
'template()' => ['{prefix}\n{tag}\n{suffix}'],
];
}

protected function run(): string
{
$this->validateString($this->getValue());

return Tag::widget()
->attributes($this->attributes)
->id($this->generateId('hidden-'))
->prefix($this->prefix)
->prefixContainer($this->prefixContainer)
->prefixContainerAttributes($this->prefixContainerAttributes)
->prefixContainerTag($this->prefixContainerTag)
->suffix($this->suffix)
->suffixContainer($this->suffixContainer)
->suffixContainerAttributes($this->suffixContainerAttributes)
->suffixContainerTag($this->suffixContainerTag)
->tagName('input')
->template($this->template)
->type('hidden')
->render();
}
Expand Down

0 comments on commit 1d40db3

Please sign in to comment.