PHPackages                             execut/yii2-crud-fields - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. execut/yii2-crud-fields

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

execut/yii2-crud-fields
=======================

A behavior for standard fields logic in CRUD based on kartik dynagrid and detailView

0.56.6(4y ago)91.1k36Apache-2.0PHPPHP ^7.4

Since Apr 2Pushed 4y ago3 watchersCompare

[ Source](https://github.com/execut/yii2-crud-fields)[ Packagist](https://packagist.org/packages/execut/yii2-crud-fields)[ Docs](https://github.com/execut/yii2-crud-fields)[ RSS](/packages/execut-yii2-crud-fields/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (17)Versions (227)Used By (6)

eXeCUT Yii2 CRUD fields. CRUD without generators and code duplication
=====================================================================

[](#execut-yii2-crud-fields-crud-without-generators-and-code-duplication)

This component allows you to automate many processes that occur in working with models, thereby reducing code duplication, and hence the total time spent:

- Writing validation rules for fields of the same type
- Writing Getters to Declare Various Relationships with Other Models
- Validating and Editing Linked Records
- Setting up the edit form for the model and its associated records
- Customizing the Model Record List
- Translating field names
- Adds the ability to extend models by a third-party module without adding new dependencies
- Simplifies the process of unit testing models

For license information check the [LICENSE](LICENSE.md)-file.

English documentation is at [docs/guide/README.md](https://github.com/execut/yii2-crud-fields/blob/master/docs/guide/README.md).

Русская документация здесь [docs/guide-ru/README.md](https://github.com/execut/yii2-crud-fields/blob/master/docs/guide-ru/README.md).

[![Latest Stable Version](https://camo.githubusercontent.com/f385e5f5ef8c2799dd784888b3dc4bd360065e3e8e330899f124044a3a4906af/68747470733a2f2f706f7365722e707567782e6f72672f6578656375742f796969322d637275642d6669656c64732f762f737461626c652e706e67)](https://packagist.org/packages/execut/yii2-crud-fields)[![Total Downloads](https://camo.githubusercontent.com/4fd7079edf8884a5aa735401cf8a1237b1bff570a59c50f9e763acbfa875bb03/68747470733a2f2f706f7365722e707567782e6f72672f6578656375742f796969322d637275642d6669656c64732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/execut/yii2-crud-fields)[![Build Status](https://camo.githubusercontent.com/40d8e06bd7858bc0120e3c5d4a352fdcdb7eff796b3a9ab6d106ea50a1bced6b/68747470733a2f2f7472617669732d63692e636f6d2f6578656375742f796969322d637275642d6669656c64732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/execut/yii2-crud-fields)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require execut/yii2-crud-fields

```

or add

```
"execut/yii2-crud-fields": "dev-master"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

For example, the following few lines of code in a model:

```
namespace execut\books\models;
class Book extends \yii\db\ActiveRecord {
    use \execut\crudFields\BehaviorStub;
    public function behaviors() {
        return [
            \execut\crudFields\Behavior::KEY => [
                'class' => \execut\crudFields\Behavior::class,
                'fields' => [
                    'id' => [
                        'class' => \execut\crudFields\fields\Id::class,
                    ],
                    'name' => [
                        'class' => \execut\crudFields\fields\StringField::class,
                        'attribute' => 'name',
                        'required' => true,
                    ]
                ],
            ],
        ];
    }
}
```

will make all required for CRUD:

```
$model = new Book();
echo 'Validation rules for the search and edit scenario';
var_dump($model->rules());
echo 'Forming ActiveQuery based on filtering parameters and configuring ActiveDataProvider';
var_dump($model->search());
echo 'Formation of list columns settings';
var_dump($model->getGridColumns());
echo 'Formation of settings for the creation/editing form';
var_dump($model->getFormFields());
```

[![Books CRUD list](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/books-list.jpg)](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/books-list.jpg)[![Books CRUD form](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/books-form.jpg)](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/books-form.jpg)

If we compare the implementation of such a model with a model without extension, we can see that the amount of code has changed in a positive direction:

[Model on native Yii2 (85 lines)](https://github.com/execut/yii2-books-native/blob/master/src/models/Book.php) vs [Model on CRUD fields (36 lines)](https://github.com/execut/yii2-books/blob/master/src/models/Book.php)

Or more strong example with books authors:

[Model on native Yii2 (370 lines)](https://github.com/execut/yii2-books-native/blob/master/src/models/Author.php) vs [Model on CRUD fields (116 lines)](https://github.com/execut/yii2-books/blob/master/src/models/Author.php)

[![Authors CRUD list](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/authors-list.jpg)](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/authors-list.jpg)[![Authors CRUD form](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/authors-form.jpg)](https://raw.githubusercontent.com/execut/yii2-crud/master/docs/guide/i/authors-form.jpg)

For more details please refer to the documentation [docs/guide/README.md](https://github.com/execut/yii2-crud-fields/blob/master/docs/guide/README.md).

Для более подробной информации обращайтесь к документации [docs/guide-ru/README.md](https://github.com/execut/yii2-crud-fields/blob/master/docs/guide-ru/README.md).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 99.7% 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 ~8 days

Recently: every ~97 days

Total

220

Last Release

1497d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ffb982747c04d8d93e2db3f8d90e44864c7c2a21a4c3d00ffbe66325f3f91c4?d=identicon)[execut](/maintainers/execut)

---

Top Contributors

[![execut](https://avatars.githubusercontent.com/u/2357407?v=4)](https://github.com/execut "execut (321 commits)")[![maxxer](https://avatars.githubusercontent.com/u/240201?v=4)](https://github.com/maxxer "maxxer (1 commits)")

---

Tags

yii2 gridyii2 fields

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/execut-yii2-crud-fields/health.svg)

```
[![Health](https://phpackages.com/badges/execut-yii2-crud-fields/health.svg)](https://phpackages.com/packages/execut-yii2-crud-fields)
```

###  Alternatives

[cinghie/yii2-traits

Yii2 Traits

116.9k8](/packages/cinghie-yii2-traits)

PHPackages © 2026

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