PHPackages                             bartacus/bartacus-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bartacus/bartacus-bundle

ActiveTypo3-cms-extension[Framework](/categories/framework)

bartacus/bartacus-bundle
========================

Integrates the Symfony full-stack framework into TYPO3

7.1.3(1w ago)1347.8k↓63.8%9[14 issues](https://github.com/Bartacus/BartacusBundle/issues)3GPL-3.0-or-laterPHPPHP ^8.4

Since May 26Pushed 3w ago8 watchersCompare

[ Source](https://github.com/Bartacus/BartacusBundle)[ Packagist](https://packagist.org/packages/bartacus/bartacus-bundle)[ RSS](/packages/bartacus-bartacus-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (53)Versions (107)Used By (3)

BartacusBundle
==============

[](#bartacusbundle)

Welcome to the BartacusBundle - the Symfony bundle + TYPO3 extension which integrates the Symfony framework fully into your TYPO3 v14.3.\* CMS.

What Bartacus Bundle does
-------------------------

[](#what-bartacus-bundle-does)

BartacusBundle transforms TYPO3 into a Symfony-first environment, allowing developers to build TYPO3 extensions and websites using modern Symfony patterns while retaining the powerful content management capabilities of TYPO3.

### Full Symfony Stack in TYPO3

[](#full-symfony-stack-in-typo3)

It initializes the project's Symfony kernel at the very beginning of the PHP process. This properly injects the full Symfony stack into TYPO3 and allows the project source code to be written as if it were a standard Symfony application.

### Event-driven Configuration

[](#event-driven-configuration)

Bartacus uses a `ConfigLoader` to hook into TYPO3's configuration lifecycle (AdditionalConfiguration, RequestMiddlewares, Extbase Persistence) via Symfony Events. This allows developers to extend or modify TYPO3's configuration using standard Symfony event listeners.

### Symfony Controllers as Content Elements

[](#symfony-controllers-as-content-elements)

You can use Symfony controllers as TYPO3 content elements by simply adding the `#[ContentElement()]` attribute to your controller methods.

- Automatically generates TypoScript configuration.
- Converts TYPO3 content object data into Symfony request/models.
- Handles `NotFoundHttpException` by triggering TYPO3's native 404 error handling.

### Integrated Symfony Routing

[](#integrated-symfony-routing)

The bundle allows you to define standard Symfony routes that coexist with TYPO3 page requests. When a Symfony route is hit:

1. It intercepts the request early in the TYPO3 middleware stack.
2. It fakes a TYPO3 request context to ensure TYPO3 configurations (like TypoScript) are loaded.
3. It handles the request via the Symfony Kernel and returns the response to the browser.

### Service Interoperability

[](#service-interoperability)

BartacusBundle provides deep integration between the Symfony Container and TYPO3's `GeneralUtility`:

- **Symfony Services in TYPO3**: Services tagged with `bartacus.make_instance` are automatically available via `GeneralUtility::makeInstance()`. This is achieved by injecting a `ServiceLocator` directly into TYPO3's `singletonInstances`.
- **TYPO3 Services in Symfony**: The `ServiceBridge` provides a clean API to access TYPO3's global state (Backend/Frontend User, LanguageService, etc.) and core components are registered as Symfony services for easy injection.

### Unified Request Localization

[](#unified-request-localization)

Normalizes the locale between TYPO3 and Symfony to ensure consistent language handling. The base locale is extracted with the following priority:

1. TYPO3 site language object from request attributes.
2. Symfony router `_locale` parameter.
3. TYPO3 site default language object.

It ensures the locale format is consistent (e.g., `de_AT` for Symfony requests, while the Symfony router uses the URL-friendly `de-at`).

### Static Routes and Optimized Middleware

[](#static-routes-and-optimized-middleware)

The bundle overrides the loading order of TYPO3 core middlewares and introduces a custom `StaticRouteMiddleware`. This ensures that static routes (like `/robots.txt`) are handled early via the `StaticRouteEvent`, avoiding unnecessary database-heavy operations. It even includes a default subscriber to generate SEO-friendly `robots.txt` files automatically.

### Enhanced Error Handling

[](#enhanced-error-handling)

Overrides both Symfony and TYPO3 error/exception handlers to provide a unified, detail-rich Symfony error page, greatly improving the debugging experience within the TYPO3 context.

### Advanced Twig and Template Integration

[](#advanced-twig-and-template-integration)

Bartacus provides a powerful bridging layer between Twig and TYPO3:

- **`TWIGTEMPLATE` Content Object**: A new TYPO3 Content Object that allows you to render Twig templates directly from TypoScript. It supports variable passing (via nested cObjects), `stdWrap`, and even rendering into TYPO3's header/footer data blocks.
- **`bartacus_cobject` Twig Function**: Allows you to execute and render any TYPO3 Content Object (like `RECORDS`, `CONTENT`, or `IMAGE`) directly from your Twig templates, with full support for data and table context.
- **`controller(...)` Twig Function**: Enables you to execute and render Symfony controllers directly from your Twig templates, seamlessly mixing Symfony logic with your template rendering.

---

How it Works
------------

[](#how-it-works)

### 1. Early Kernel Bootstrap

[](#1-early-kernel-bootstrap)

The bundle requires patching TYPO3's entry points (`public/index.php` and `vendor/bin/typo3`) to initialize the `SymfonyBootstrap` class. This class boots the Symfony Kernel before TYPO3 starts, making the Symfony Container available throughout the entire TYPO3 lifecycle.

### 2. Service Container Hooking

[](#2-service-container-hooking)

During the bundle's boot process, it manipulates `GeneralUtility`'s internal state. It injects a `ServiceLocator` into `GeneralUtility::singletonInstances` and updates the `finalClassNameCache`. This "infects" TYPO3's service resolution, allowing Symfony to fulfill requests for instances that it manages.

### 3. Middleware Interception

[](#3-middleware-interception)

The bundle registers several middlewares in the TYPO3 Frontend stack:

- **Static Route Middleware**: Intercepts requests for static paths and dispatches a `StaticRouteEvent`.
- **Route Resolver**: Checks for Symfony route matches before TYPO3 tries to resolve a page.
- **Content Element Renderer**: Handles the execution of controllers for content elements during the page rendering process.

### 4. Data Bridging (ServiceBridge)

[](#4-data-bridging-servicebridge)

The `ServiceBridge` acts as a central hub for TYPO3 integration. It allows you to safely access global state and provides helper methods for common TYPO3 tasks (like getting the current backend user or rendering a content object) without relying on global variables.

### 5. Event-driven Configuration (ConfigLoader)

[](#5-event-driven-configuration-configloader)

The `ConfigLoader` acts as a bridge during the TYPO3 configuration phase. It dispatches Symfony events that allow the bundle (and other Symfony bundles) to inject configuration like custom middlewares or Extbase persistence classes directly into TYPO3.

### 6. Template Bridging

[](#6-template-bridging)

The `template` namespace provides a bi-directional bridge for rendering. It allows TYPO3 to use Twig as a rendering engine via the `TWIGTEMPLATE` cObject, and allows Twig templates to pull in TYPO3 content via the `bartacus_cobject` function.

---

Patches
-------

[](#patches)

The bundle relies on several patches to achieve this deep integration:

- `allow_extbase_access_in_cli_mode.patch`: Enables TYPO3 Extbase usage in CLI by faking a request object.
- `enable_symfony_serviceBridge.patch`: Injects the custom service bridge into `GeneralUtility`.
- `proper_symfony_kernel_bootstrap_cli.patch`: Patches `vendor/bin/typo3` for early kernel boot.
- `proper_symfony_kernel_bootstrap_web.patch`: Patches `public/index.php` for early kernel boot.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance76

Regular maintenance activity

Popularity38

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity97

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~6 days

Total

98

Last Release

13d ago

Major Versions

2.4.4 → 4.0.22023-09-07

3.3.2 → 5.0.02024-02-28

5.1.0 → 6.0.02024-10-17

5.2.1 → 6.2.12025-03-12

6.2.3 → 7.0.02026-07-12

PHP version history (8 changes)0.1.0PHP ~5.4

1.0.0-beta1PHP ^7.1

2.0.0PHP ^7.2

3.2.0PHP ^7.4 || ^8.0

3.3.0PHP ^8.0

4.0.0PHP ^8.1

6.0.0PHP ^8.3

7.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7a150ce702951d86d4bff20f7a71cc234f08f8ca7022a4083289f4c44422391?d=identicon)[EmiiKhaos](/maintainers/EmiiKhaos)

---

Top Contributors

[![QuingKhaos](https://avatars.githubusercontent.com/u/993350?v=4)](https://github.com/QuingKhaos "QuingKhaos (273 commits)")[![Aricura](https://avatars.githubusercontent.com/u/7595116?v=4)](https://github.com/Aricura "Aricura (69 commits)")[![simonkey](https://avatars.githubusercontent.com/u/1583145?v=4)](https://github.com/simonkey "simonkey (27 commits)")[![jdkpix](https://avatars.githubusercontent.com/u/7509640?v=4)](https://github.com/jdkpix "jdkpix (24 commits)")[![lzadravec](https://avatars.githubusercontent.com/u/12605836?v=4)](https://github.com/lzadravec "lzadravec (2 commits)")[![mmunz](https://avatars.githubusercontent.com/u/3017481?v=4)](https://github.com/mmunz "mmunz (1 commits)")[![PaperCoder](https://avatars.githubusercontent.com/u/7293634?v=4)](https://github.com/PaperCoder "PaperCoder (1 commits)")

---

Tags

symfonycontainerframeworktwigservicesintegrationtypo3service container

### Embed Badge

![Health badge](/badges/bartacus-bartacus-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/bartacus-bartacus-bundle/health.svg)](https://phpackages.com/packages/bartacus-bartacus-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M430](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k257.3M12.4k](/packages/symfony-framework-bundle)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M236](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
