PHPackages                             aminkt/yii2-category-module - 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. aminkt/yii2-category-module

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

aminkt/yii2-category-module
===========================

Category Module

1.0.0(7y ago)0217LGPL-3.0-or-laterPHPCI failing

Since Sep 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aminkt/yii2-category-module)[ Packagist](https://packagist.org/packages/aminkt/yii2-category-module)[ RSS](/packages/aminkt-yii2-category-module/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (3)Used By (0)

category manager
================

[](#category-manager)

Category Module

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist saghar/yii2-category-module "v1.1.0.x-dev"

```

or add

```
"saghar/yii2-category-module": "v1.1.0.x-dev"

```

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

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

[](#configuration)

Once the extension is installed, simply use it in your code by :

1. Add module configuration to your config file in module section like as:

```
'category' => [
    'class' => \saghar\category\Category::class,
    'modelClass' => \path\to\your\Model::class,
    'searchModelClass' => \path\to\your\search\Model::class
],
```

> Note: You can leave `modelClass` and `searchModelClass` blank to use default models of module. If you are using mongo db, you can use models implemented in `\saghar\category\models\mongo`

2. Run migration files of module using `yii migrate --migrationPath=@vendor/saghar/yii2-category-module/src/migrations --interactive=0`

> Note: If you are using mongo db please skip this step.

Advanced configuration
----------------------

[](#advanced-configuration)

If you want use your own model feel free to write your own code but please be aware about this steps to configurate your your app using Category module.

1. Create your own Active record and implement `\saghar\category\interfaces\CategoryInterface`
2. In you configuration file define your models like described in configuration section.

Done.

Use Category module api to create, update, delete and fetch your categories.
----------------------------------------------------------------------------

[](#use-category-module-api-to-create-update-delete-and-fetch-your-categories)

You can use `\saghar\category\controllers\RestApiController` and extend your controller from this file. This file will provide below actions and routes:

```
GET /v2/category      // List of all categories.
GET /v2/category/[id]  // Detail of one single category.
DELETE /v2/category/[id]  // Delete a single category from server.
POST /v2/category     // Create a new category.
PUT /v2/category/[id]    // Update  category.

```

> Note: All request except index and view shoud use at least one auth method to authrize user.

> Warning: Cross origin is disabled by default. if you have any problem with this please report it.

CONTRIBUTING
------------

[](#contributing)

[If you want help us to improve this module please check this linkg.](CONTRIBUTING.md)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 53.6% 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 ~318 days

Total

2

Last Release

2472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bbb96d5331db7b7c0f1003fdd294ad8865fe7df33cc68bf6cf6fad5550f461e?d=identicon)[aminkt](/maintainers/aminkt)

---

Top Contributors

[![aminkt](https://avatars.githubusercontent.com/u/14914854?v=4)](https://github.com/aminkt "aminkt (15 commits)")[![sagharmojdehi](https://avatars.githubusercontent.com/u/57499485?v=4)](https://github.com/sagharmojdehi "sagharmojdehi (13 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/aminkt-yii2-category-module/health.svg)

```
[![Health](https://phpackages.com/badges/aminkt-yii2-category-module/health.svg)](https://phpackages.com/packages/aminkt-yii2-category-module)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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