How to Use the Twig Template Engine
OSTraining
Course Summary
Twig is a very powerful template engine for PHP. Twig is safe, fast, easy-to-learn and is used by many different platforms.
-
+
Course Description
Twig is a very powerful template engine for PHP. Twig is safe, fast, easy-to-learn and is used by many different platforms.In this class, you'll learn how to use Twig for your projects.
In the first half of the class, you'll see how to install and configure Twig. You'll then explore Twig's syntax, including filters, comments, math operators and more.
In the second half of the class, you use if/else statements, includes statements and extensions to create powerful and flexible layouts.
Robert learned HTML/CSS back in 2008 when he decided to start a film review site, and he continued adding to his site file-by-file the old-fashioned way for a year. When he asked a web developer friend how to build a site that "automatically lists content on the homepage and stuff," he was pointed to Drupal.
Since then, Robert has continued to build his experience with the CMS by using it on his own projects and by managing other brands' pre-existing Drupal sites. In doing so, he has learned some of the best ways to use the tools Drupal has available--and what mistakes to avoid.
In his spare time, Robert trains Brazilian Jiu Jitsu and works on too many side programming projects. He is also the author of two books.
-
+
Course Syllabus
Introduction
Introduction to TwigFree
How to Install Twig
How to Set Up Twig
Twig Syntax
Array Data and Twig Comments
How to Access Twig Object Data and Methods
How to Perform Math Operations to Twig
Filters
How to Alter Twig's Output With Filters
How to Use Block-level Filters in Twig
Loops and If Else Statements
How to Use For Loops in Twig
How to Use If Else Statements in Twig
How to Use If Else Or Statements in Twig
Includes and Extensions
How to Use Includes Statements in Twig
Twig Extensions and Child Templates
Twig Quiz