PHP code example of lumturo-net / contao-globals-wrapper
1. Go to this page and download the library: Download lumturo-net/contao-globals-wrapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lumturo-net / contao-globals-wrapper example snippets
use LumturoNet\Globals\Dca;
$dca = Dca::new(string $namespace);
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,
]);
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']);
use LumturoNet\Globals\Lang;
Lang::set($namespace);
$dca->field('text')
->label(__('sharkday'));
use LumturoNet\Globals\Lang;
$dca->field('text')
->label(__('deleteConfirm', 'MSC'));
use LumturoNet\Globals\Models;
use Namespace\Models\MyModel;
use Namespace\Models\MySecondModel;
Models::bind([
'tl_tabelle' => MyModel:class,
'tl_tabelle_2' => MySecondModel::class,
...
]);