Skip to content

Commit 30c18ab

Browse files
committed
Added replacement of Form::hiddenForm macro
1 parent ccdc575 commit 30c18ab

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
2.1.0 (2025-05-23)
5+
------------------
6+
7+
- Added replacement of `Form::hiddenForm` macro
8+
9+
410
2.0.0 (2025-05-21)
511
------------------
612

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ The supported methods are:
4949
* open(options)
5050
* close()
5151
* label(name, value, options, escape)
52-
* labelRequired(name, value, options, escape)
52+
* labelRequired(name, value, options, escape) **(AXN-Informatique macro)**
53+
* hiddenForm(options) **(AXN-Informatique macro)**
5354
* input(type, name, value, options)
5455
* text(name, value, options)
5556
* number(name, value, options)

src/Converter.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public static function execute(array $files): int
4949
} elseif ($formBuilderMethod === 'close') {
5050
$result = static::buildFormClose();
5151

52+
} elseif ($formBuilderMethod === 'hiddenForm') {
53+
$result = static::buildHiddenForm(
54+
$formBuilderArgs[0] ?? ''
55+
);
56+
5257
} elseif (\in_array($formBuilderMethod, ['label', 'labelRequired'])) {
5358
$result = static::buildLabel(
5459
$formBuilderArgs[0],
@@ -216,6 +221,16 @@ protected static function buildFormClose(): string
216221
return static::$indent.'</form>';
217222
}
218223

224+
protected static function buildHiddenForm(string $options): string
225+
{
226+
$input = static::$indent.'@push(\'extra-html\')'."\n";
227+
$input .= static::buildFormOpen($options)."\n";
228+
$input .= static::buildFormClose()."\n";
229+
$input .= static::$indent.'@endpush';
230+
231+
return $input;
232+
}
233+
219234
protected static function buildLabel(string $for, string $value, string $options, string $escape, bool $required): string
220235
{
221236
$extractedOptions = static::extractArrayFromStringWithCheckOptionsTagIfFailed($options);

0 commit comments

Comments
 (0)