PHPackages                             porcelanosa/yii2-posts - 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. porcelanosa/yii2-posts

ActiveYii2-extension[Framework](/categories/framework)

porcelanosa/yii2-posts
======================

The module is mostly for the backend, but partly for the frontend too.

016PHP

Since Nov 21Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Posts Module
============

[](#posts-module)

Module for different type of post, like articles, news, blog post etc. [![ERR Diagram](posts_err_diagram.png)](posts_err_diagram.png)

Dependencies
------------

[](#dependencies)

```
    use \kartik\switchinput\SwitchInput;
    use mihaildev\ckeditor\CKEditor;
    use mihaildev\elfinder\ElFinder;

```

```
"porcelanosa/yii2-toggle-column": "*",

```

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

[](#installation)

#### 1. Run composer

[](#1-run-composer)

```
composer require porcelanosa/yii2-posts
```

#### 2. Common config

[](#2-common-config)

Add to *'common/config/main.php'*

```

    ......
    'modules' => [
        'posts' => [
            'class' => 'porcelanosa\posts\Module',
        ],
    ],
    ......
```

#### 3. Backend config

[](#3-backend-config)

Add to *'backend/config/main.php*

```
'module' => [
    ...
    'posts' => [
        'class'  => 'porcelanosa\posts\Module',
            'controllerMap' => [
                'cpposts' => [
                    'class'     => 'porcelanosa\posts\controllers\AdminController',
                    'as access' => [
                        'class' => \yii\filters\AccessControl::className(),
                        'rules' => [
                            [
                                'allow' => true,
                                'roles' => ['admin'],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
    ...
```

If you rename CintrollerMap name from 'cpposts' you must rename *'modules/posts/views/cppost/'* folder also.

#### 4. Migration

[](#4-migration)

Run migration

```
yii migrate --migrationPath=@vendor/porcelanosa/yii2-posts/migrations

```

#### 5. Routes

[](#5-routes)

Add rules to UrlManager For example,

```
// posts with post_types 'articles'
[
    'pattern' => 'articles',
    'route' => 'posts/default/index',
    'defaults' => ['post_type_slug' => 'articles'],
],
[
    'pattern' => 'articles//',
    'route' => 'posts/default/view',
    'defaults' => ['post_type_slug' => 'articles'],
],
// posts with post_types 'news'
[
    'pattern' => 'news',
    'route' => 'posts/default/index',
    'defaults' => ['post_type_slug' => 'news'],
],
[
    'pattern' => 'news//',
    'route' => 'posts/default/view',
    'defaults' => ['post_type_slug' => 'news'],
],
//'confirm-order' => 'cart/confirmorder',
// Posts
[
    'pattern' => 'posts///',
    'route' => 'posts/default/view'
],
[
    'pattern' => 'posts//',
    'route' => 'posts/default/catview'
],
[
    'pattern' => 'posts/',
    'route' => 'posts/default/index'
],
```

or different for route to *'posts/default/view'*

#### 6. Add module to bootstrap

[](#6-add-module-to-bootstrap)

Add

```
'bootstrap'           => ['posts'],
```

to common/config/main.php

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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/e29ecf9bce5c9dd15cb8cd490e0528d6b72d1e97443aacfa50461a93d4498cf7?d=identicon)[porcelanosa](/maintainers/porcelanosa)

---

Top Contributors

[![porcelanosa](https://avatars.githubusercontent.com/u/518981?v=4)](https://github.com/porcelanosa "porcelanosa (13 commits)")

### Embed Badge

![Health badge](/badges/porcelanosa-yii2-posts/health.svg)

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

###  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)
