awesome-twig

A curated list of amazingly awesome Twig extensions, snippets and tutorials

Github stars Tracking Chart

Awesome Twig Awesome

A curated list of snippets, tutorials, extensions for Twig created by Fabien Potencier and PHP frameworks using Twig

You might also like awesome-php.

Please read the contribution guidelines before contributing.

Twig

Cheatsheets

  1. Drupal Twig
  2. Timber Twig
  3. Craft Twig
  4. https://github.com/andreia/awesome-twig - A collection of useful Twig snippets.
  5. https://github.com/okeeffed/cheat-sheets/blob/master/twig-cheat-sheet.md
  6. http://willthemoor.github.io/Twig-Cheat-Sheet/
  7. https://issuu.com/idcf-france/docs/twig-cheatsheet
  8. https://www.cheatography.com/ryguydg/cheat-sheets/symfony-and-twig/
  9. https://i.pinimg.com/originals/9b/7c/f0/9b7cf0ed69f91af8bdbf3d55ec5f893e.jpg

CMS & frameworks using Twig

Packagist for Frameworks, Packagist for CMS

  • Symfony - PHP framework created by Fabien Potencier, also creator of Twig
  • Silex - PHP micro-framework based on Symfony also created by Fabien Potencier
  • ezPublish - open source enterprise PHP content management system
  • Themosis - A WordPress framework
  • Drupal8 - Popular PHP CMS
  • Timber - Templating system for Wordpress
  • OctoberCMS - PHP CMS based on Laravel
  • CraftCMS - Focused content management for web professionals
  • phpBb - Free and Open Source Forum Software

There's also a lot of frameworks & cms created by community using twig. There is also many packages integration for other frameworks such as Laravel, Slim, Yii Framework, CodeIgniter, CakePHP, etc.

Stack Overflow

Extensions

Packagist

  • Paginator Twig Extension - Twig extension to help generate simple paginations in Twig templates.
  • Truncate Text - A custom twig extension to truncate text while preserving HTML tags.
  • HTML Compress - Twig extension for compressing HTML and inline CSS/JS using WyriHaximus/HtmlCompress
  • Breakpoints - Twig extension to set breakpoints
  • PHP Functions - This extension allows you to call (almost) any PHP function from your Twig templates.
  • Var Type Checker - Simple var type checker for Twig
  • core23/twig-extensions - Bunch of awesome twig extensions by core23
  • twigphp/twig-extensions - Bunch of awesome official twig extensions
  • jasny/twig-extensions - Bunch of awesome twig extensions by jasny
  • kzykhys/twig-extensions - Bunch of awesome twig extensions by kzykhys
  • vudaltsov-legacy/twig-extensions - Bunch of awesome twig extensions by kzykhys
  • JMB-Technology-Limited/twig-extensions - Bunch of awesome twig extensions by JMB-Technology-Limited
  • SortByField - A Twig Extension filter to sort an array of entries (objects or arrays) by an entry field.
  • Assetic - Twig extension of PHP assets manager
  • Asset Version - Render versioned asset filenames in twig.
  • Laravel DebugBar - Twig extensions for the Laravel library LaravelDebugBar
  • PHP DebugBar - A Twig extension to provide access to PHP Debug Bar's rendering functions.
  • Twi18n - Powerful Twig translation extension using PHP's gettext.
  • Cache - Cache fragments of templates directly within Twig.
  • Markdown - Twig extension to work with Markdown content
  • Markdown² - A simple twig markdown extension.
  • Defer Block Rendering - An extension for Twig that allows to defer block rendering
  • GetText Extractor - friendly tool which extracts translations from twig templates.
  • Twig Lambda - Lambda expressions for Twig and filters that make use of them
  • EmailObfuscator - A text filter for automatic email obfuscation using the well-established Javascript and a CSS fallback:
  • Configurable i18n - extension allowing you to customize which functions to use for translations.
  • Webpack - Inject your webpack entry points into twig templates with easy.
  • Country - Twig country filter extension for twig
  • MobileDetect - MobileDetect-integration for Twig
  • emberlabs/Gravatar - easy gravatar twig integration by emberlabs
  • ry167Gravatar² - An extension for Twig that provides simple filters for Gravatar by ry167.
  • HTML Helpers - Rails style view helpers for HTML tags in PHP Twig
  • QRCode - A Twig extension for embedding inline QR codes in Twig templates
  • Whitespace Collapse - Whitespace collapse extension for Twig
  • Const Resolver - Simple Twig plugin to resolve constant on template cache build
  • OrdinalNumber - A Twig Extension filter to format number into ordinal form (1st, 2nd, etc.).
  • Apply Filters - This filter allows you to call dynamic filters in twig.
  • Strftime - use strftime function in twig
  • SVG - Add inline svg with Twig$
  • csg4twig - A CSV escaping filter for the Twig templating engine.
  • Share - Twig extension providing social share links
  • Parsedown (Markdown Parser) - Parsedown's Markdown parser Extension
  • Linewrap - Twig filter to wrap lines exceeding the specified length.
  • Inflection - Filters (singularize and pluralize)
  • Array Group - Twig filter that splits an array into a given number of groups (unlike batch, which splits the array based on items per group)
  • Geshi - Twig extension to work with Geshi - Generic Syntax Highlighter rendering
  • Natural Join - Twig filter that joins an array using a different separator for the last element
  • Gist - A simple Twig extension for embedding GitHub Gist snippets into Twig templates.
  • Resource - Resource handling for Twig templates
  • LocaleName - Twig locale name filter extension for twig
  • Safe Date - A safe date function in twig that will not set null dates to today.
  • Useful HTML Extension - Some useful Twig functions for context-relevant class rendering.
  • CSRF Helpers - CSRF (Cross-Site Request Forgery) protection helpers for the Twig templating engine.
  • Linkify - Twig extension for Linkify - converts URLs and email addresses into HTML links
  • HTMLStrip - Filter for Twig to convert HTML into Text
  • List Loop - A different way to display lists, grids and tables in Twig: the list loop.
  • faker - Integration of PHP faker library with the twig templating system.
  • Twital - It's a plugin for Twig that adds some sugar syntax, which makes its templates similar to PHPTal or VueJS.

Snippets

Code editors & IDE extensions

Check this page to discover the multiples extensions for IDE & code editors created by community

Tutorials

Coming soon

Tools

  • TwigExpress - Getting started with Twig templates thanks to a simple PHP script
  • TwigFiddle - Develop, run, store and access Twig code online
  • Twigcs - Check for violations on Twig coding standard
  • Read more

Javascript Alternatives

Python Alternatives


License

CC0

To the extent possible under law, Julien RAVIA has waived all copyright and related or neighboring rights to this work.

Main metrics

Overview
Name With OwnerJulienRAVIA/awesome-twig
Primary Language
Program language (Language Count: 0)
Platform
License:Creative Commons Zero v1.0 Universal
所有者活动
Created At2018-04-10 11:05:13
Pushed At2024-09-29 00:19:55
Last Commit At2024-09-29 02:19:55
Release Count0
用户参与
Stargazers Count19
Watchers Count0
Fork Count2
Commits Count16
Has Issues Enabled
Issues Count1
Issue Open Count0
Pull Requests Count4
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private