承接 lumturo-net/contao-globals-wrapper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lumturo-net/contao-globals-wrapper

Composer 安装命令:

composer require lumturo-net/contao-globals-wrapper

包简介

Ein objektorientierter Wrapper für das GLOBALS Array in Contao

README 文档

README

Eine Contao Extension die das arbeiten mit DCAs extrem erleichtert.

Entwickelt mit PHP7.3 und Contao 4.9.

Installation

Installation via composer

composer require lumturo-net/contao-globals-wrapper

TL_DCA

use LumturoNet\Globals\Dca;

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

Konfigurationen

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

Vorhandene Konfiguration erweitern

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

Exceptions

DcaConfigNotSetException

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

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

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

Exceptions

DcaListNotSetException

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

Felder

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

Vorhandenes Feld erweitern

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

Exceptions

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 & 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

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

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

Ü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

use LumturoNet\Globals\Lang;

Lang::set($namespace);

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

Übersetungen aus anderem Namespace holen

use LumturoNet\Globals\Lang;

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

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

BindingExistsException

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

BE_MOD

use LumturoNet\Globals\Backend;

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

TL_HOOKS

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

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

TL_CSS

use LumturoNet\Globals\Css;

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

Exceptions

CssExistsException

Wird zurückgegeben wenn die hinzuzufügende CSS bereits in TL_CSS vorhanden ist

lumturo-net/contao-globals-wrapper 适用场景与选型建议

lumturo-net/contao-globals-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 07 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「wrapper」 「globals」 「contao」 「dca」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lumturo-net/contao-globals-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lumturo-net/contao-globals-wrapper 我们能提供哪些服务?
定制开发 / 二次开发

基于 lumturo-net/contao-globals-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-20