0
votes

I've installed MopaBootstrapBundle using the guidelines on the official website of the bundle.

My config.yml:

 mopa_bootstrap:
     menu': ~

My template:

{{ mopa_bootstrap_menu('mymenu') }}

My src/Menu/Builder.php:

namespace SsiBundle\Menu;

use Knp\Menu\FactoryInterface;

class Builder
{
    public function createMainMenu(FactoryInterface $factory, array $options)
    {
        $menu = $factory->createItem('root', array(
            'navbar' => true,
        ));
        $layout = $menu->addChild('Layout', array(
            'icon' => 'home',
            'route' => 'moje',
        ));

        return $menu;
    }
}

I get the following exception:

FileLoaderLoadException in FileLoader.php line 130: There is no extension able to load the configuration for "mopa_bootstrap" (in C:\xampp\htdocs\SSI\app/config\config.yml). Looked for namespace "mopa_bootstrap", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "debug", "web_profiler", "sensio_distribution" in C:\xampp\htdocs\SSI\app/config\config.yml (which is being imported from "C:\xampp\htdocs\SSI\app/config/config_dev.yml").

How can I fix this issue?

1

1 Answers

0
votes

You need to enable the bundle in app/AppKernel.php.

Otherwise the bundled extension that processes configuration under the namespace mopa_bootstrap and registers the mopa_bootstrap_menu twig function is not available in your application.

Ensure the bundle is enabled in AppKernel as shown below and clear you cache afterwards to resolve your issue.

public function registerBundles()
    {
        $bundles = array(
            // ...
            new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),