Skip to main content
Bundles are the primary building blocks of Oro applications. Every feature — whether built by Oro, a partner, or a customer — lives inside a bundle. Extensions are Composer packages that bundle one or more bundles and are distributed through the Oro Extensions Store.

Create a Bundle

Set up a new bundle from scratch — directory structure, extension class, service container configuration, and registration.

Install an Extension

Install a published extension from the Oro Extensions Store using Composer.

Add to Extensions Store

Package and publish your bundle as an extension on the Oro Extensions Store.

Create a bundle

Bundle file structure

Create the bundle class under the chosen namespace:
// src/Acme/Bundle/DemoBundle/AcmeDemoBundle.php

namespace Acme\Bundle\DemoBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeDemoBundle extends Bundle
{
}

Service container extension

Create a DI extension to load your bundle’s configuration files:
// src/Acme/Bundle/DemoBundle/DependencyInjection/AcmeDemoExtension.php

namespace Acme\Bundle\DemoBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class AcmeDemoExtension extends Extension
{
    #[\Override]
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yml');
    }
}

Enable the bundle

1

Create the bundles.yml file

Register your bundle in Resources/config/oro/bundles.yml:
bundles:
    - { name: Acme\Bundle\DemoBundle\AcmeDemoBundle, priority: 255 }
All such files across installed packages are automatically discovered and parsed.
2

Clear the cache

php bin/console cache:clear
In production, add --env=prod to the command.
3

Verify the bundle is active

php bin/console debug:container --parameter=kernel.bundles --format=json | grep AcmeDemoBundle
Expected output:
"AcmeDemoBundle": "Acme\\Bundle\\DemoBundle\\AcmeDemoBundle",

Bundle-less structure

As an alternative to the classic bundle layout, Oro supports placing application-specific code in a flatter structure without a dedicated bundle class. See the Architecture overview for more details.

References

Build docs developers (and LLMs) love