contao/docs

Document new `InsertTagsSystem` `[Contao ^5.2.x]`

Closed this issue · 2 comments

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

#[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

Need more information

The PRs do explain how to use it, I wonder if there is more that I missed? /cc @ausi

Closing in favor of #1381