PHPackages                             d3yii2/d3system - 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. d3yii2/d3system

ActiveLibrary[Framework](/categories/framework)

d3yii2/d3system
===============

Yii2 system

12.1k↓50%3[1 PRs](https://github.com/d3yii2/d3system/pulls)1PHP

Since Jul 16Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/d3yii2/d3system)[ Packagist](https://packagist.org/packages/d3yii2/d3system)[ RSS](/packages/d3yii2-d3system/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (1)

[![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](https://www.yiiframework.com/)

d3system
========

[](#d3system)

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

[](#installation)

```
composer require d3yii2/d3system dev-master
```

module configuration in seperate configfile
-------------------------------------------

[](#module-configuration-in-seperate-configfile)

Module extend from D3Module

```
class Module extends D3Module
{
}
```

In configuration file define only path

```
        'd3persons' => [
            'class' => 'yii2d3\d3persons\Module',
            'configFilePath' => __DIR__ .'/module_d3persons.php'
        ],
```

In module configuration file add module class for IDE suggester

```
return [
    'class' => 'yii2d3\d3persons\Module',
    'ownerExpire' => '+10 years',
    'userExpire' => '+10 days',
];
```

Configuration
-------------

[](#configuration)

add translation

```
$config = [
   'components' => [
        'i18n' => [
            'translations' => [
                'd3system*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@d3yii2/d3system/messages',
                    'sourceLanguage' => 'en-US',
                ],
                'crud' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@d3yii2/d3system/messages',
                    'sourceLanguage' => 'en-US',
                ],
            ]
        ]
    ]
];
```

Components
----------

[](#components)

### D3Flag

[](#d3flag)

configuration:

```
'components' => [
    // ... existing components ...
    'flag' => [
        'class' => \app\components\Flag::class,
        'flags' => [
            // simplest boolean
            'newCheckout' => true,

            // enabled but only for certain users
            'betaProfile' => [
                'enabled' => true,
                'users' => [1, 2, 10],
            ],

            // percentage rollout (by userId)
            'searchV2' => [
                'enabled' => true,
                'percent' => 20, // 20% of users
            ],

            // enabled only if user has RBAC permission/role
            'adminPanelV2' => [
                'enabled' => true,
                'roles' => ['admin'],
            ],
        ],
        'cacheId' => 'cache',
        'cacheTtl' => 30,
    ],
],
```

Usage

```
if (Yii::$app->flag->enabled('newCheckout')) {
    // new flow
} else {
    // old flow
}
```

### ModelsList

[](#modelslist)

Configuration:

```
 'components' => [
        'ModelsList' => [
            'class' => 'd3system\compnents\ModelsList',
            'cacheKey' => 'd3system\modeList',
            'cacheDuration' => 3600
        ]

```

Usage:

```
  $modelId = \Yii::$app->ModelsList->getId($model);
```

### Compnent commands

[](#compnent-commands-)

d3system must be defined as module in console config

```
    'modules' => [
        'd3system' => [
            'class' => 'd3system\Module'
        ],
    ]
```

Extens from D3CommandComponent

```
use d3system\compnents\D3CommandComponent;
class DailyActivityNotification extends D3CommandComponent {

    public $setting1;
    public $setting2;

    public function init()
    {
        //init logic
    }

    public function run(D3ComponentCommandController $controller) : bool
    {
        parent::run($controller);
        //runing logic
    }
}
```

Define as component in console config

```
    'components' => [
        'activityEmail' => [
        'class' => 'd3yii2\d3activity\components\DailyActivityNotification',
        'setting1' => 15,
        'setting2' => 22,
    ]
```

Executing command component

```
yii d3system/d3-component-command activityEmail,component2,component3
```

Date &amp; Time conversions
---------------------------

[](#date--time-conversions)

Dependency

Conversion works only for the model attributes suffixed vith "\_local" A example, instead

```
$model->YOUR_ATTRIBUTE
```

use

```
$model->YOUR_ATTRIBUTE_local
```

### Add behavior config in model

[](#add-behavior-config-in-model)

Add the behavior to your model and list the attributes need to be converted Important: do NOT add the "\_local" suffix here!

```
public function behaviors(): array
{
    return D3DateTimeBehavior::getConfig(['YOUR_ATTRIBUTE']);
}
```

Or if You need custom options (see the )

```
public function behaviors()
{
    return [
        'datetime' => [
            'class' => D3DateTimeBehavior::className(), // Our behavior
            'attributes' => [
                'YOUR_ATTRIBUTE', // List all editable date/time attributes
            ],
            // Date formats or other options
           'originalFormat' => ['datetime', 'yyyy-MM-dd HH:mm:ss'],
           'targetFormat' => 'date',
        ]
    ];
}
```

### Display value in view

[](#display-value-in-view)

```

```

### Assign the value before save

[](#assign-the-value-before-save)

```
$model->load(Yii::$app->request->post());
```

or

```
 $model->YOUR_ATTRIBUTE_local = $value;
```

or

```
 $model->setAttribute('YOUR_ATTRIBUTE_local', $value);
```

By multiple assignment via load() ensure the local attributes have 'safe' rules:

```
// Virtual params for DateTimeBehavior
public function rules(): array
{
    return [
        [...],
        [['YOUR_ATTRIBUTE_local'], 'safe'],
    ];
}
```

D3EditableAction Initial Setup in Controller

```
editAbleFields: must match real attributes
editAbleFieldsForbbiden: must match real attributes
modelName: pass current controller model Name with full Namespace

```

```
/**
 * @var array
 */
public $editAbleFields = ['hasEditable', 'status'];

/**
 * @var array
 */
public $editAbleFieldsForbbiden = [];
```

Actions

```
public function actions()
{
    return [
        'editable'      => [
            'class'                   => D3EditableAction::class,
             'modelName'               => AudAuditor::class,
             'editAbleFields'          => ['status','notes'],
             'editAbleFieldsForbbiden' => $this->editAbleFieldsForbbiden,
             'preProcess' => static function (Inout $model) {
                  if ($model->isAttributeChanged('driver')) {
                     $model->driver = iconv('UTF-8', 'ASCII//TRANSLIT',$model->driver);
                  }
             },
             'outPreProcess' => static function (ContInout $model, array $output) {
                 if (isset($output['ediBookingId'])) {
                     $output['ediBookingId'] = DepoEdiBookingDictionary::getIdLabel($output['ediBookingId']);
                 }
                 return $output;
             }
        ],
    ];
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance58

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 77.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/542187ba859514d10d0952dca77df8ea889a9651b249d0b5b513da791fd2919b?d=identicon)[uldisn](/maintainers/uldisn)

---

Top Contributors

[![uldisn](https://avatars.githubusercontent.com/u/3525344?v=4)](https://github.com/uldisn "uldisn (188 commits)")[![anothersoftware-lv](https://avatars.githubusercontent.com/u/9327511?v=4)](https://github.com/anothersoftware-lv "anothersoftware-lv (42 commits)")[![viljums](https://avatars.githubusercontent.com/u/6377908?v=4)](https://github.com/viljums "viljums (6 commits)")[![Faks](https://avatars.githubusercontent.com/u/1909645?v=4)](https://github.com/Faks "Faks (4 commits)")[![rokorolov](https://avatars.githubusercontent.com/u/6349248?v=4)](https://github.com/rokorolov "rokorolov (1 commits)")[![baltixAB](https://avatars.githubusercontent.com/u/35080900?v=4)](https://github.com/baltixAB "baltixAB (1 commits)")[![VairisO](https://avatars.githubusercontent.com/u/9198246?v=4)](https://github.com/VairisO "VairisO (1 commits)")

### Embed Badge

![Health badge](/badges/d3yii2-d3system/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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