PHPackages                             nill/yii2-blogs-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. [Framework](/categories/framework)
4. /
5. nill/yii2-blogs-category-module

ActiveLibrary[Framework](/categories/framework)

nill/yii2-blogs-category-module
===============================

Blogs Category module for Yii2-start

1261PHP

Since Jul 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Mefistophell/yii2_blogs_category_module)[ Packagist](https://packagist.org/packages/nill/yii2-blogs-category-module)[ RSS](/packages/nill-yii2-blogs-category-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2-Start module Blogs-Category
================================

[](#yii2-start-module-blogs-category)

Blogs-Category module for Yii2-Start application.

This Module allows creating categories for the Blog.

There is also a widget that allows you to filter the blog posts by categories for the frontend.

> Does not require to change Blog Module!

About
-----

[](#about)

**Version:** 0.9.1

**Authors:** Mefistophell Nill

TODO
----

[](#todo)

```
public function setCategory()
{
    $post = Yii::$app->request->post('Blog');
    if (!$this->isNewRecord) {
        Yii::$app->db->createCommand()->update('{{%blogs_to_category}}', ['category_id' => $post['category'], 'blog_id' => $this->id], ['blog_id' => $this->id])->execute();
        return true;
    }
}

```

The temporary decision. I shall be grateful for improvement.

```
public function afterSave($insert, $changedAttributes)
{
    parent::afterSave($insert, $changedAttributes);

    if (!$this->category) {
        $post = Yii::$app->request->post('Blog');
        Yii::$app->db->createCommand()->insert('{{%blogs_to_category}}', ['category_id' => $post['category'], 'blog_id' => $this->id], ['blog_id' => $this->id])->execute();
        return true;
    }
}

```

Requirements
------------

[](#requirements)

This module is used with Yii2-Start application [yii2-start](https://github.com/vova07/yii2-start).

Installation
============

[](#installation)

Install via Composer
--------------------

[](#install-via-composer)

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

Either run

```
php composer.phar require nill/yii2-blogs-category-module "dev-master"

```

or add

```
"nill/yii2_blogs_category_module": "dev-master"

```

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

Install from an Archive File
----------------------------

[](#install-from-an-archive-file)

Download and extract the zip-file into the folder with your project

```
/my/path/to/yii2-start/vendor/nill/yii2_blogs_category_module

```

Configuration
=============

[](#configuration)

- Add module to \[backend\] config section:

```
'blogs_category' => [
    'isBackend' => true
],

```

- Add module to \[common\] config section:

```
'blogs_category' => [
    'class' => 'nill\blogs_category\Module'
],

```

- Add the module to extensions in the top of the file "vendor\\yiisoft\\extensions.php":

```
'nill/blogs_category' =>
    array(
        'name' => 'nill/yii2-blogs-category-module',
        'version' => '0.1.0.0',
        'alias' =>
        array(
            '@nill/blogs_category' => $vendorDir . '/nill/yii2-blogs-category-module',
        ),
        'bootstrap' => 'nill\\blogs_category\\Bootstrap',
    ),

```

- Create a new table in your database from file: `yii2_start_blogs_category.sql`
- Add in table `yii2_start_blogs` column: name: `category_id` type: `int(11)`. This can be done by running the query SQL:

```
ALTER TABLE yii2_start_blogs ADD category_id INT(11) NOT NULL;

```

OR: Apply migration with console commands:

`php yii migrate --migrationPath=@nill/blogs_category/migrations`

Backend
-------

[](#backend)

For work of the module in the backend follows add it to the menu: `vendor\vova07\yii2-start-themes\admin\views\layouts\sidebar-menu.php`

```
[
    'label' => 'Blogs Category'),
    'url' => ['/blogs_category/default/index'],
    'icon' => 'fa-folder-open',
    'visible' => Yii::$app->user->can('administrateBlogs') || Yii::$app->user->can('BViewBlogs'),
],

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/972251ff202e307d13c2a9b1fa63f21110a3953be4d5b781e43e53bdc6ce5fdd?d=identicon)[Mefistophell](/maintainers/Mefistophell)

---

Top Contributors

[![Mefistophell](https://avatars.githubusercontent.com/u/8115245?v=4)](https://github.com/Mefistophell "Mefistophell (12 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[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.

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

A simple API extension for DateTime.

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

PHPackages © 2026

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