Drupal 8 Twig vs PHP template and twig basics
Drupal 8 uses Twig framework instead of PHPTemplate. This means that now, instead of the usual *.tpl.php files we use the *.html.twig files.
Twig is a PHP-based compiled templating language. When your web page renders, the Twig engine takes the template and converts it into a 'compiled' PHP template which it stores in a protected directory in sites/default/files/php/twig. The compilation is done once. Template files are cached for reuse and are recompiled on clearing the Twig cache.
- Check the drupal page to compare the two theming paradigms
- Official Twig theming guide.
- Drupalize.me covers the Twig templating basics via video series for drupal theme developers
- There are some code level differences. Take a look at this page to get basic info.
I would also recommend to watch this session on Twig from DrupalCon Portland.
Another video which gives good intro of Twig