PHPackages                             myzero1/yii2-apibyconf - 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. myzero1/yii2-apibyconf

ActiveYii2-module

myzero1/yii2-apibyconf
======================

It is for api by yii2.

1.0.1(6y ago)01MITPHP

Since Aug 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/myzero1/yii2-apibyconf)[ Packagist](https://packagist.org/packages/myzero1/yii2-apibyconf)[ RSS](/packages/myzero1-yii2-apibyconf/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

yii2-apibyconf
==============

[](#yii2-apibyconf)

You can generate restfull api by configuration.

Show time
---------

[](#show-time)

[![](https://github.com/myzero1/show-time/raw/master/yii2-apibyconf/screenshot/201.png)](https://github.com/myzero1/show-time/blob/master/yii2-apibyconf/screenshot/201.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-apibyconf/screenshot/202.png)](https://github.com/myzero1/show-time/blob/master/yii2-apibyconf/screenshot/202.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-apibyconf/screenshot/203.png)](https://github.com/myzero1/show-time/blob/master/yii2-apibyconf/screenshot/203.png)

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

[](#installation)

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

Either run

```
php composer.phar require myzero1/yii2-apibyconf：*

```

or add

```
"myzero1/yii2-apibyconf": "*"

```

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

Setting
-------

[](#setting)

Once the extension is installed, simply modify your application configuration as follows:

`In main-local.php`

```
...
if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    ...
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
    $config['modules']['gii']['generators'] = [
        'rest' => [
            'class' => 'myzero1\apibyconf\components\gii\generators\rest\Generator'
        ],
    ];
    ...
}
...
```

`In main.php`

```
return [
    ......
    'bootstrap' => [
        ......
        'example',
        ......
    ],
    ......
    'modules' => [
        ......
        'example' => '\myzero1\apibyconf\example\ApiByConfModule',// should add table to db by 'example/models/user.sql'
        'apibyconf' => 'myzero1\apibyconf\Module',
        ......
    ],
    ......
    'components' => [
        ......
        'user' => [
            'identityClass' => 'myzero1\apibyconf\components\rest\ApiAuthenticator',
            'enableSession' => false,
            'authTimeout' => 3600 * 24, // defafult 24h
        ],
        ......
    ]
    ......
];
```

Usage
-----

[](#usage)

### Selectable modules

[](#selectable-modules)

- Set basePath to "/v2"
- Click the "Preview" button
- Click the "Generate" button, to Generate the codes.
- Set the config files

`In main.php`

```
return [
    ......
    'bootstrap' => [
        ......
        'v1',
        ......
    ],
    ......
    'modules' => [
        ......
        'v1' => [
            'class' => 'backend\modules\v1\ApiByConfModule',
            'docToken' => 'docTokenAsMyzero1',
            'apiTokenExpire' => 24 * 3600 * 365,
            'fixedUser' => [
                'id' => '1',
                'username' => 'myzero1',
                'api_token' => 'myzero1Token',
            ],
            'runningAsDocActions' => [
                // '*' => '*', // all ations, as default
                // 'controllerA' => [
                //     '*', // all actons in controllerA
                // ],
                // 'controllerB' => [
                //     'actionB',
                // ],
                'user' => [
                    'create',
                    'index',
                ],
            ],
        ],
        ......
    ],
    ......
];
```

- the `v2` will display to Selectable modules menu as `v2 api`
- you can click the `v2 api` button to config the `v2`

### The other menu of apibyconfig

[](#the-other-menu-of-apibyconfig)

- you can click the `Swagger` button to use it.
- you can click the `Markdown` button to use it.

### change logs

[](#change-logs)

- Add my group
- Carding code

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

2468d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22048203?v=4)[myzero1](/maintainers/myzero1)[@myzero1](https://github.com/myzero1)

---

Top Contributors

[![myzero1](https://avatars.githubusercontent.com/u/22048203?v=4)](https://github.com/myzero1 "myzero1 (46 commits)")

### Embed Badge

![Health badge](/badges/myzero1-yii2-apibyconf/health.svg)

```
[![Health](https://phpackages.com/badges/myzero1-yii2-apibyconf/health.svg)](https://phpackages.com/packages/myzero1-yii2-apibyconf)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)

PHPackages © 2026

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