<commit_before>Twig Integration
================

Services tagged as `menu` will be added automatically to the Twig helper. You
can access those menus with the `{% menu %}` tag in your Twig templates,
followed by the name of your service. 

Here is a complete but simple example for a Menu named `main`, used as your
main navigation for the whole page (expecting you have a `MainBundle` where you
store all your menus).

Enable both Dependency Injection extensions in your `config.yml`:

    # app/config/config.yml
    main.config: ~
    menu.twig: ~


Create a Dependency Injection `MainExtension` and a `menuLoad()` function:

    <?php // src/Application/MainBundle/DependencyInjection/MainExtension.php
    
    namespace Application\MainBundle\DependencyInjection;
    
    use Symfony\Component\DependencyInjection\Extension\Extension,
        Symfony\Component\DependencyInjection\Loader\XmlFileLoader,
        Symfony\Component\DependencyInjection\ContainerBuilder;
    
    class MainExtension extends Extension
    {
        public function menuLoad($config, ContainerBuilder $container)
        {
            $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
            $loader->load('menu.xml');<commit_msg>Fixed config.yml for Twig integration<commit_after>Twig Integration
================

Services tagged as `menu` will be added automatically to the Twig helper. You
can access those menus with the `{% menu %}` tag in your Twig templates,
followed by the name of your service. 

Here is a complete but simple example for a Menu named `main`, used as your
main navigation for the whole page (expecting you have a `MainBundle` where you
store all your menus).

Enable both Dependency Injection extensions in your `config.yml`:

    # app/config/config.yml
    main.menu: ~
    menu.twig: ~


Create a Dependency Injection `MainExtension` and a `menuLoad()` function:

    <?php // src/Application/MainBundle/DependencyInjection/MainExtension.php
    
    namespace Application\MainBundle\DependencyInjection;
    
    use Symfony\Component\DependencyInjection\Extension\Extension,
        Symfony\Component\DependencyInjection\Loader\XmlFileLoader,
        Symfony\Component\DependencyInjection\ContainerBuilder;
    
    class MainExtension extends Extension
    {
        public function menuLoad($config, ContainerBuilder $container)
        {
            $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
            $loader->load('menu.xml');
{'fraction_non_alphanumeric': 0.09282868525896415, 'fraction_numerical': 0.0, 'mean_word_length': 3.6847014925373136, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5383955', 'n_tokens_mistral': 663, 'n_tokens_neox': 629, 'n_words': 219}