✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn

Templating with Twig

  • 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

Well done!

You have completed Custom Functions!

Sign up for Treehouse Back to Library

Quiz Question 1 of 5

Which of the following is NOT true when defining a macro?

Choose the correct answer below:

Skip Quiz Review Video
  • A

    If extra positional arguments are passed to a macro, they end up in the special varargs variable as a list of values.

  • B

    If you want an argument to be optional, you MUST define a default value

  • C

    You MAY set a default value when defining an argument.

  • D

    Macros only know about the variables that have been passed.

Report Question

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.

Report this Question

There was an error while reporting the question. Please try again, or contact support directly.

Describe the issue (optional) (required)

Your feedback has been submitted.
Thank you!

Oh no!

If you continue experiencing problems, please contact support at help@teamtreehouse.com.

Your Exam Has Ended

Sign up for Treehouse!

Quizzes are the best way to test your knowlege. Sign up for Treehouse today and prove yourself. We guarantee 100% satisfaction.

Free trial Sign in Next video