Closed zoglo closed 5 months ago
The following PRs:
included a new insert-tags-system in Contao 5.2+. It apparently allows registering insert tags via PHP Annotations.
5.2+
Normal usage
#[AsInsertTag('link_url')]
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/LinkInsertTag.php#L38-#L117
With fragments
#[AsInsertTag('date', asFragment: true)]
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/DateInsertTag.php#L22-#L90
Flags
#[AsInsertTagFlag('number_format')]
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Flag/FormatFlag.php#L23-#L30
The PRs do explain how to use it, I wonder if there is more that I missed? /cc @ausi
#[AsBlockInsertTag('iflng', endTag: 'iflng')]
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/IfLanguageInsertTag.php#L23-L25
Closing in favor of #1381
Description
The following PRs:
included a new insert-tags-system in Contao
5.2+
. It apparently allows registering insert tags via PHP Annotations.Examples
Normal usage
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/LinkInsertTag.php#L38-#L117
With fragments
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/DateInsertTag.php#L22-#L90
Flags
Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Flag/FormatFlag.php#L23-#L30
Need more information
The PRs do explain how to use it, I wonder if there is more that I missed? /cc @ausi