filmov
tv
[EN] WORKING WITH TWIG IN SYMFONY // “Tips and tWricks”
Показать описание
Twig is really linked with Symfony, but rarely gets love during online conferences.
⚡️ Yet, it's incredibly powerful and useful in many ways, to save source code writing, to achieve common algorithmic operations, etc.
This talk goes through a few interesting things regarding Twig:
🌾 the Twig / Symfony bridge
🌾 good practices with usage (SEO, performance, directory architecture, forms, etc.)
🌾 general information like coding standards, escaping, philosophy, etc.
🌾 how to extend Twig and why you would need to do such a thing
🌾 smart tricks you probably never thought about
🌾 usages and REX on advanced functionalities (caching, translations, etc.)
🌾 real life examples, through OROCommerce, Sylius, Drupal, Symfony UX, etc.
Let's show some love to our favorite templating engine! 💚
00:00 Intro
00:38 ⭐️ About me
02:03 ⭐️ A quick introductory note
05:12 ⭐️ Fundamentals
05:19 What is Twig?
08:25 A template engine, really?
10:16 Every Twig template becomes a PHP class!
11:00 Under the hood: lexing, parsing, compiling, then evaluating
13:16 Twig version history
14:15 Where Twig comes from
15:59 Live testing Twig
16:27 Configuring Twig
18:05 Coding standards
19:14 IDE & text editors integration
19:44 Please (auto)format your Twig templates
21:10 ⭐️ Quick Twig tips
21:16 Interpolation
22:11 Defensive programming
24:20 Quick internals
25:18 Slices
26:41 For subsets and slices
27:10 Parents
28:43 REGEX
29:17 Loading templates
29:37 Whitespace control
30:50 Named arguments
31:31 In
34:00 Dates!
35:46 Object attributes & methods
36:36 |raw and |escape
39:50 HTML-wide classes & lang
40:28 Define canonical URLs
41:29 Changing lexer options
41:56 Simple cycling
42:21 Testing blocks
42:58 Conditional includes
43:26 ⭐️ Stuff you know & never use
45:27 ⭐️ Where to place your logic
47:40 ⭐️ Organizing templates
47:57 Organizing your templates
51:13 MakerBundle CRUDL reuse
52:07 Mirror your controllers
53:19 Don't be afraid of logic subdirs!
53:56 Metadata
54:53 ⭐️ The SF-Twig Bridge and Bundle
55:10 URL generation
53:33 Using Twig in any class (services)
55:33 Dump
56:24 Overriding form themes
57:09 RAM caching
57:50 App stuff provided by TwigBridge
58:36 Assets versioning & cache invalidation
59:09 Edge-side includes at a glance
01:01:01 ⭐️ Extending
01:01:20 Extending Twig
01:03:48 Examples from Symfony UX, OroCommerce, Sylius Commerce, Drupal, etc.
01:05:37 ⭐️ Security
01:08:37 ⭐️ Real world example: handling custom content blocks
01:14:11 ⭐️ GDPR
01:15:51 One last funy thing... :)
01:16:45 Thanks!
⚡️ Yet, it's incredibly powerful and useful in many ways, to save source code writing, to achieve common algorithmic operations, etc.
This talk goes through a few interesting things regarding Twig:
🌾 the Twig / Symfony bridge
🌾 good practices with usage (SEO, performance, directory architecture, forms, etc.)
🌾 general information like coding standards, escaping, philosophy, etc.
🌾 how to extend Twig and why you would need to do such a thing
🌾 smart tricks you probably never thought about
🌾 usages and REX on advanced functionalities (caching, translations, etc.)
🌾 real life examples, through OROCommerce, Sylius, Drupal, Symfony UX, etc.
Let's show some love to our favorite templating engine! 💚
00:00 Intro
00:38 ⭐️ About me
02:03 ⭐️ A quick introductory note
05:12 ⭐️ Fundamentals
05:19 What is Twig?
08:25 A template engine, really?
10:16 Every Twig template becomes a PHP class!
11:00 Under the hood: lexing, parsing, compiling, then evaluating
13:16 Twig version history
14:15 Where Twig comes from
15:59 Live testing Twig
16:27 Configuring Twig
18:05 Coding standards
19:14 IDE & text editors integration
19:44 Please (auto)format your Twig templates
21:10 ⭐️ Quick Twig tips
21:16 Interpolation
22:11 Defensive programming
24:20 Quick internals
25:18 Slices
26:41 For subsets and slices
27:10 Parents
28:43 REGEX
29:17 Loading templates
29:37 Whitespace control
30:50 Named arguments
31:31 In
34:00 Dates!
35:46 Object attributes & methods
36:36 |raw and |escape
39:50 HTML-wide classes & lang
40:28 Define canonical URLs
41:29 Changing lexer options
41:56 Simple cycling
42:21 Testing blocks
42:58 Conditional includes
43:26 ⭐️ Stuff you know & never use
45:27 ⭐️ Where to place your logic
47:40 ⭐️ Organizing templates
47:57 Organizing your templates
51:13 MakerBundle CRUDL reuse
52:07 Mirror your controllers
53:19 Don't be afraid of logic subdirs!
53:56 Metadata
54:53 ⭐️ The SF-Twig Bridge and Bundle
55:10 URL generation
53:33 Using Twig in any class (services)
55:33 Dump
56:24 Overriding form themes
57:09 RAM caching
57:50 App stuff provided by TwigBridge
58:36 Assets versioning & cache invalidation
59:09 Edge-side includes at a glance
01:01:01 ⭐️ Extending
01:01:20 Extending Twig
01:03:48 Examples from Symfony UX, OroCommerce, Sylius Commerce, Drupal, etc.
01:05:37 ⭐️ Security
01:08:37 ⭐️ Real world example: handling custom content blocks
01:14:11 ⭐️ GDPR
01:15:51 One last funy thing... :)
01:16:45 Thanks!