Twig Common Extension can be easily installed using composer
composer require parisek/twig-common
$twig = new Twig_Environment($loader);
$twig->addExtension(new Parisek\Twig\CommonExtension());
Will load YAML to variable
{% set sidebar = source('sidebar.yml')|yaml_parse %}
Will return content without translation (useful for debug without translation extension)
{{ "Hello"|t }}
Will generate unique ID on the page
{{ uniqueId() }}
Will return content without translation (useful for debug without translation extension)
{% trans with {'context': 'domain name'} %}{{ variable }}{% endtrans %}