Twig is a full peer of Smarty on Core dna, and this unit has the same shape and depth as the Smarty one. It assumes The shared model, and it is written for developers who may know Twig from elsewhere: the places where the platform departs from the upstream manual are called out where they arise.
Begin with Twig in Core dna: autoescaping is off, strict variables are off, and a handful of things the manual takes for granted are not installed. Twig syntax covers output, record attributes, loops and the platform's own set; Twig inheritance, includes, embed and macros covers composition and the template context. What the platform adds to Twig is the reference for the platform's filters and its empty test, and Twig security sets out what a site without a sandbox or autoescaping must review instead, and where translation comes from when there is no translation extension.