Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Twig Screencast

Parent Feed: 

Submitted by Dennis Hoyer on Wed, 11/12/2013 - 14:22

The template engine Twig will be a component of the Drupal 8 core and is replacing PHPTemplate. The new syntax brings a lot of changes and a simpler system. The function access is restricted, which results in a more secure system. The consistent use of the syntax improves the readability of template files extremely.

Motivation

I am going to show you the Basics of Twig in this short eight minute long screencast. You can see how to print variables or how to access objects or arrays via the punctual syntax. I will also demonstrate the use of control structures like if or for loops. After this video, you will be able to use Twig without the trouble of looking up the simple Twig syntax.

Further information

If that wasn't enough you can additionally read Steffen’s posts for the Twig basics [1] [2] or Luca’s about converting Drupal themes to Twig.

Since this is my first screencast, I would enjoy some constructive feedback.

 

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web