PHPackages                             lumturo-net/contao-globals-wrapper - 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. lumturo-net/contao-globals-wrapper

ActiveContao-bundle

lumturo-net/contao-globals-wrapper
==================================

Ein objektorientierter Wrapper für das GLOBALS Array in Contao

1.0.8(3y ago)037MITPHPPHP ^7.4|^8.0

Since Nov 3Pushed 3y agoCompare

[ Source](https://github.com/lumturo-net/contao-globals-wrapper)[ Packagist](https://packagist.org/packages/lumturo-net/contao-globals-wrapper)[ RSS](/packages/lumturo-net-contao-globals-wrapper/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (10)Used By (0)

Contao Globals Wrapper
======================

[](#contao-globals-wrapper)

Eine Contao Extension die das arbeiten mit DCAs extrem erleichtert.

Entwickelt mit PHP7.3 und Contao 4.9.

Installation
------------

[](#installation)

Installation via composer

```
composer require lumturo-net/contao-globals-wrapper
```

TL\_DCA
-------

[](#tl_dca)

```
use LumturoNet\Globals\Dca;

$dca = Dca::new(string $namespace);
```

Konfigurationen
---------------

[](#konfigurationen)

```
$dca->config()
    ->dataContainer('Table')
    ->cTable(['tl_tabelle'])
    ->enableVersioning()
    ->custom([
        // Eigene Konfigurationsfelder
    ])
    ->sql([
        'keys' => ['id' => 'primary']
    ]);
```

### Vorhandene Konfiguration erweitern

[](#vorhandene-konfiguration-erweitern)

`$dca->config([bool $extend])`

### Exceptions

[](#exceptions)

`DcaConfigNotSetException`

> Wird zurückgegeben wenn `$extend = true` und zu erweiternde Konfiguration nicht vorhanden ist.

Listen
------

[](#listen)

```
$dca->list()
    ->sorting()
        ->fields(['title'])
        ->mode(1)
        ->flag(11)
        ->panelLayout('search;filter')
        ->compile()
    ->label()
        ->fields(['title'])
        ->compile()
    ->globalOperations('all')
        ->label($label)
        ->href()
        ->class()
        ->attributes()
        ->compile()
    ->operations('edit')
        ->href()
        ->icon()
        ->compile()
```

### Vorhandene Liste erweitern

[](#vorhandene-liste-erweitern)

`$dca->list([bool $extend])`

### Exceptions

[](#exceptions-1)

`DcaListNotSetException`

> Wird zurückgegeben wenn `$extend = true` und die zu erweiternde Liste nicht vorhanden ist.

Felder
------

[](#felder)

```
$dca->fields('mein_feld')
    ->text()
    ->label(string|array $label)
    ->exclude()
    ->eval()
        ->mandatory()
        ->maxlength(255)
        ->compile()
    ->relation([
        'hasOne' => 'lazy'
    ])
    ->sql()
```

### Vorhandenes Feld erweitern

[](#vorhandenes-feld-erweitern)

`$dca->field('singleSRC', [bool $extend])`

### Exceptions

[](#exceptions-2)

`DcaFieldExistsException`

> Wird zurückgegeben wenn `$extend = false` und Feld mit selben Namen im selben Namespace erstellt werden soll.

`DcaFieldNotSetException`

> Wird zurückgegeben wenn `$extend = true` und das zu erweiterndes Feld nicht vorhanden ist.

Paletten &amp; Subpaletten
--------------------------

[](#paletten--subpaletten)

```
$dca->palettes(string $palette)
    ->group('title_legend' [string $translations, boolean $hidden])
    ->fields([
        'mein_feld',
        'anderes_feld',
        'nochein_feld'
    ])
    ->compile()

$dca->subpalette('mein_feld')
    ->fields([
        'unterfeld_1',
        'unterfeld_2'
    ])
    ->compile();
```

TL\_CTE
=======

[](#tl_cte)

Mit `Cte::new($namespace)->push(Array [])` können Mappings von Inhaltselementen zu ihren respektiven Klassen definiert werden.

```
use LumturoNet\Globals\Cte;
use Namespace\Elements\MyCustomElement1;
use Namespace\Elements\MyCustomElement2;
use Namespace\Elements\MyCustomElement3;

Cte::new(string $namespace)->push([
    'MyCustomElement1' => MyCustomElement1::class,
    'MyCustomElement2' => MyCustomElement2::class,
    'MyCustomElement3' => MyCustomElement3::class,
]);
```

TL\_LANG
========

[](#tl_lang)

Mit dem Language Wrapper können sowohl neue Übersetzungen erstellt, als auch aus existierenden Übersetzungen entsprechende Werte ausgelesen werden.

Übersetzung erstellen
---------------------

[](#übersetzung-erstellen)

```
use LumturoNet\Globals\Lang;

$lang = Lang::set($namespace);
$lang->trans('MyCustomElement1', 'Ein cooles Inhaltselement')
     ->trans('MyCustomElement2', 'Und noch eins')
     ->trans('MyCustomElement3', 'Elemente gründen Gewerkschaft');
     ->trans('sharkday', ['Haitag', 'Es ist Haitag']);
```

Übersetzungen holen
-------------------

[](#übersetzungen-holen)

```
use LumturoNet\Globals\Lang;

Lang::set($namespace);

$dca->field('text')
    ->label(__('sharkday'));
```

Übersetungen aus anderem Namespace holen
----------------------------------------

[](#übersetungen-aus-anderem-namespace-holen)

```
use LumturoNet\Globals\Lang;

$dca->field('text')
    ->label(__('deleteConfirm', 'MSC'));
```

TL\_MODELS
==========

[](#tl_models)

**!! Ab Contao 4.9.x !!**

Durch das Modelbinding ist es möglich, dass die Klassen der Models anders benannt sein können als die Tabellen in der Datenbank.

```
use LumturoNet\Globals\Models;

use Namespace\Models\MyModel;
use Namespace\Models\MySecondModel;

Models::bind([
    'tl_tabelle'   => MyModel:class,
    'tl_tabelle_2' => MySecondModel::class,
    ...
]);
```

### Exceptions

[](#exceptions-3)

`BindingExistsException`

> Wird zurückgegeben wenn eines der übergebenen Bindings bereits existiert

BE\_MOD
=======

[](#be_mod)

```
use LumturoNet\Globals\Backend;

Backend::new(string $namespace, string $module, [int $position = 1])->tables([
    'tl_tabelle_1',
    'tl_tabelle_2',
    ...
]);
```

TL\_HOOKS
=========

[](#tl_hooks)

```
use LumturoNet\Globals\Hooks;
use Namespace\Hooks\AddCommentHook;

$hooks = Hooks::get()
$hooks->activateAccount(array $myCallback)
      ->addComment([AddCommentHook::class, 'addCommentHook']);
```

TL\_CSS
=======

[](#tl_css)

```
use LumturoNet\Globals\Css;

Css::push([
    'path/to/file1.css',
    'path/to/file2.css',
    ...
]);
```

### Exceptions

[](#exceptions-4)

`CssExistsException`

> Wird zurückgegeben wenn die hinzuzufügende CSS bereits in TL\_CSS vorhanden ist

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~98 days

Recently: every ~132 days

Total

9

Last Release

1225d ago

PHP version history (3 changes)v1.0.0-betaPHP ^7.1

1.0.1PHP ^7.4

1.0.5PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/98feaddd3dc4d0d19139d2183f2be44f13d09ff3045b3da49f5d74640472582f?d=identicon)[lumturo](/maintainers/lumturo)

---

Top Contributors

[![HardRockinMan](https://avatars.githubusercontent.com/u/74240700?v=4)](https://github.com/HardRockinMan "HardRockinMan (50 commits)")[![cubex-hro](https://avatars.githubusercontent.com/u/46573494?v=4)](https://github.com/cubex-hro "cubex-hro (4 commits)")[![chrischi1989](https://avatars.githubusercontent.com/u/1976543?v=4)](https://github.com/chrischi1989 "chrischi1989 (1 commits)")

---

Tags

wrappercontaodcaglobals

### Embed Badge

![Health badge](/badges/lumturo-net-contao-globals-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/lumturo-net-contao-globals-wrapper/health.svg)](https://phpackages.com/packages/lumturo-net-contao-globals-wrapper)
```

###  Alternatives

[terminal42/dcawizard

dcaWizard extension for Contao Open Source CMS

10370.7k15](/packages/terminal42-dcawizard)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[madeyourday/contao-rocksolid-custom-elements

Create your own, nestable content elements using a modular system. End the WYSIWYG chaos with your own content elements.

50341.9k12](/packages/madeyourday-contao-rocksolid-custom-elements)[mvo/contao-group-widget

Adds a new group widget that allows repeating a set of DCA fields.

28124.3k31](/packages/mvo-contao-group-widget)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[terminal42/contao-node

Node bundle for Contao Open Source CMS

3172.5k4](/packages/terminal42-contao-node)

PHPackages © 2026

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