Skip to content

Commit 5200ca8

Browse files
committed
Merge branch 'main' of github.com:vardumper/extended-htmldocument
2 parents 2a98068 + 2135d95 commit 5200ca8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ echo (string) Anchor::create($dom)
2727
// output is:
2828
// <a class="secondary" href="https://google.com" rel="nofollow" title="Google it"></a>
2929
```
30+
## Twig Templates
31+
There's now a Twig Template for every HTML element included. These allow for better consistency in your design system(s), support all possible HTML attributes and have basic validations for enum attributes. They are compatible with different ways of using Twig (`include`, `embed` and `use`).
32+
```php
33+
$twig->path('vendor/vardumper/extended-htmldocument/templates', 'html'); /** register template path with or without namespace */
34+
```
35+
```twig
36+
{% include '@html/inline/a.twig' with {
37+
href: 'https://example.com',
38+
title: 'Some info about the link'
39+
rel: 'nofollow',
40+
role: 'button',
41+
content: '<strong>Click here</strong>'
42+
} %}
43+
```
3044

3145
## Documentation
3246
See the [Documentation](https://vardumper.github.io/extended-htmldocument/) for more.

0 commit comments

Comments
 (0)