Verwendung: Custom Elements mit TWIG: Wo kommt die Logik hin
Produkt: Custom Elements Contao
Hallo,
wenn ich Custom Elements mit TWIG verwende, wo kann man dann noch Logik per PHP in die Custom Elements integrieren? In Twig selber kann ich ja kein PHP Code ausführen.
Danke im Voraus und Freundliche Grüße,
Andreas
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by RockSolid Theme... on 13 Feb, 2024 11:29 AM
Vielen Dank für Ihre Frage.
In der Regel ist es nicht nötig in Twig-Templates PHP-Code auszuführen, da es für die meisten Anwendungsfälle Alternativen gibt.
Sollte dennoch eigene Logik integriert werden müssen, so ist dies mit Twig Extensions möglich. Weitere Informationen dazu finden Sie in der Dokumentation von Contao: https://docs.contao.org/dev/framework/templates/getting-started/#custom-code