Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
/ twig-element Public archive

⚛️ Twig template extension that provides object-oriented HTML manipulation.

License

Notifications You must be signed in to change notification settings

craftplugins/twig-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

Important

This extension is no longer maintained.

TwigElement

TwigElement is a Twig extension to manipulate HTML as object abstractions.

Usage

{# element(tag, content, attributes) #}
{{ element('input') }}
{# Outputs: <input type="" name=""> #}
{{ element('img').src('image.jpg') }}
{# Outputs: <img src="image.jpg" alt=""> #}
{{ element('a', 'Example Link', { href: 'http://example.com/' }) }}
{# Outputs: <a href="http://example.com/">Example Link</a> #}

Refer to the HtmlObject documentation for methods of element instances.

About

⚛️ Twig template extension that provides object-oriented HTML manipulation.

Resources

License

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /