Here is the Symfony Guide to writing Twig Extensions: http://symfony.com/doc/current/cookbook/templating/twig_extension.html
Note it says to provide:
// src/AppBundle/Twig/AppExtension.php
namespace AppBundle\Twig;
class AppExtension extends \Twig_Extension
{
public function getName()
{
return 'app_extension';
}
}
Here is the Twig API: https://github.com/twigphp/Twig/blob/1.x/lib/Twig/Extension.php
There is no getName function() there.
So why do we have to provide one? What purpose does it serve?