Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Templating with Twig Course (How To)

via Treehouse

Overview

Templating languages and tools are used with frameworks like Slim and Laravel to incorporate PHP and logic into static HTML web pages. In this course we will see how to apply Object-Oriented methodology to views (web pages with HTML).

What you'll learn

  • Templating engines
  • Separation of concerns
  • Prepare a Twig template using variables and control structures
  • Inheritance in Twig

Syllabus

Templating Languages

Using a templating language for views, restricts the available logic, while providing a clean and simplified language that makes these templates more accessible for non-programmers as well. There are many options when choosing a template engine. This course will demonstrate the use of Twig, one of the most common template engines in PHP

Chevron 18 steps
  • What is a Template Engine?

    3:45

  • Installing Twig

    4:43

  • Twig View

    5 questions

  • Template Language

    4:28

  • Escaping and Comments

    3:53

  • Twig Syntax

    5 questions

  • The Structure of Control

    6:13

  • Working with Date

    3:17

  • Filters and Functions

    7 questions

  • Combining Templates

    7:09

  • Adding a Second Page

    3:23

  • Sharing

    6 questions

  • Custom Functions with Macros

    4:22

  • Importing and Using Macros

    3:28

  • Multiple Macros

    2:51

  • Custom Functions

    5 questions

  • Extending Twig and Beyond

    1:51

  • Your next step

    1 question

Reviews

Start your review of Templating with Twig Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.