PHPackages                             dilshoddevoloper/yii2-cms-private - 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. dilshoddevoloper/yii2-cms-private

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

dilshoddevoloper/yii2-cms-private
=================================

Yii2 cms private extension

1.0.0(5y ago)023BSD-3-ClausePHP

Since Dec 3Pushed 3y agoCompare

[ Source](https://github.com/RuzimurodovDilshodbek/yii2-cms-private)[ Packagist](https://packagist.org/packages/dilshoddevoloper/yii2-cms-private)[ Docs](https://www.github.com/)[ RSS](/packages/dilshoddevoloper-yii2-cms-private/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

yii-2-cms extension
===================

[](#yii-2-cms-extension)

The extension allows:

- make html blocks of html contents, files, images.
- make collections for options like tags, categories
- make entities for items like sliders, products, reviews, articles, pages
- support up to 5 languages
- support SEO meta tags
- make multiple menu with parenting feature

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

[](#installation)

- Install with composer:

```
composer require afzalroq/yii2-cms "^1.0"
```

- **After composer install** run console command for create tables:

### Add to console config for auto discover migrations

[](#add-to-console-config-for-auto-discover-migrations)

```
'controllerMap' => [
    'migrate' => [
        'class' => MigrateController::class,
        'autoDiscover' => true,
        'migrationPaths' => [
            '@vendor/afzalroq/yii2-cms/migrations'
        ],
    ],
]
```

```
php yii migrate/up --migrationPath=@vendor/afzalroq/yii2-cms/migrations
```

### Setup in common config file

[](#setup-in-common-config-file)

> CKEditor use Elfinder plugin for save files and images. Refer [Elfinder readme](https://github.com/MihailDev/yii2-elfinder) for proper configuration

- Language indexes related with database columns.
- Admin panel tabs render by array values order
- For Items, Options and Menu must be isset common\\models\\User model

```
'modules' => [
    'cms' => [ // don`t change module key
        'class' => '@afzalroq\cms\Module',
        // storage
        'path' => $params['storageRoot'], // dirname(__DIR__, 2) . '/storage'
        'host' => $params['storageHostInfo'], // 'https://site.example'
        'cache' => 'cache', // default cache component name
        'cacheDuration' => 3600, // default cache duration 3600 second
        // images
        'imageOperation' => 'cropResize',
        'imageBackground' => 'transparent',
        'imageXPos' => 'center',
        'imageYPos' => 'center',
        'fallback' => $params['storageRoot'] . '/fallback.png',
        'watermark' => $params['storageRoot'] . '/logo.png',
        // i18n
        'languages' => [
            'ru' => [
                'id' => 0, // must start from 0 up to 4
                'name' => 'English',
            ],
            'en' => [
                'id' => 1,
                'name' => 'Русский',
            ],
            'uz' => [
                'id' => 2,
                'name' => 'O`zbek tili',
            ],
        ],
        // for add to menu controller actions
        'menuActions' => [
            '' => 'Home',
            'site/contacts' => 'Contacts',
        ]
    ],
]
```

> By default uses for caching component with name "cache". Config as belove:

```
'components' => [
    'cache' => [
        'class' => 'yii\caching\FileCache',
        'cachePath' => Yii::getAlias('@frontend') . '/runtime/cache'
    ],
]
```

- In admin panel open management via link:

```
/cms/home/index
```

### Added Laravels dd() (dump and die) method

[](#added-laravels-dd-dump-and-die-method)

```
$array = ['a', 'b'];
dd($array);
```

### Examples

[](#examples)

TODO

- test
- Copy from extension root directory example widgets for frontend integration

Usage
=====

[](#usage)

### Use in frontend CController extending CMSController for proper menu generated links work

[](#use-in-frontend-ccontroller-extending-cmscontroller-for-proper-menu-generated-links-work)

```
class CController extends CMSController {

    public function actionCollection(string $c)
    {
    }

    public function actionOption(string $c, string $o)
    {
    }

    public function actionEntity(string $e)
    {
    }

    public function actionItem(string $e, int $i)
    {
    }
}
```

### Unit getter

[](#unit-getter)

```
Unit::get('slug'); // will return data using cache
```

---

### Item Getters

[](#item-getters)

```
\afzalroq\cms\entities\front\OaI::getItemIdsByCollection($slug) : array // of item Ids
\afzalroq\cms\entities\front\OaI::getItemIdsByOption($slug) : array // of item Ids
```

```
 $item->getText1(); // for get Text 1
 $item->getText2(); // for get Text 2
 $item->getText3(); // for get Text 3
 $item->getText4(); // for get Text 4
 $item->getText5(); // for get Text 5
 $item->getText6(); // for get Text 6
 $item->getText7(); // for get Text 7

 //for to get meta description and meta keywords just use this command below:
 $item-registerMetaTags(); //it generates meta tags in your view page
```

### Return File URI

[](#return-file-uri)

```
 $item->getFile1(); // for get File 1
 $item->getFile2(); // for get File 2
 $item->getFile3(); // for get File 3
```

### Return Datetime with specified format

[](#return-datetime-with-specified-format)

```
 $item->getDate($format); // for get date with format like "d.m.Y H:i:s"
```

### Return image URI by specified operation(default `cropResize`)

[](#return-image-uri-by-specified-operationdefault-cropresize)

### [View all image operations &amp; examples from documentation](https://github.com/Gregwar/Image#usage)

[](#view-all-image-operations--examples-from-documentation)

```
// get gallery main photo URI
$item->getGalleryPhoto(width, height, operation, background, xPos, yPos)

// get gallery photos URI
$items->getPhotos() // and use with "foreach(){}"

// item photos URI
 $item->getPhoto1(width, height, operation, background, xPos, yPos); // for get Photo 1
 $item->getPhoto2(width, height, operation, background, xPos, yPos); // for get Photo 2
 $item->getPhoto3(width, height, operation, background, xPos, yPos); // for get Photo 3
```

---

### Option Getters

[](#option-getters)

```
 $option->getName(); // for get Name

 $option->getContent(); // for get Content

 $option->getPhoto1(); // for get Photo 1
 $option->getPhoto2(); // for get Photo 2

 $option->getFile1(); // for get File 1
 $option->getFile2(); // for get File 2

 //for to get meta description and meta keywords just use this command below:
 $option-registerMetaTags(); //it generates meta tags in your view page
```

### Option and Items searches

[](#option-and-items-searches)

```
 \afzalroq\cms\entities\front\Items::getEntityItemSearchResults((array) $entitySlugs, $search); // get search results with entity and items

 \afzalroq\cms\entities\front\Items::getOptionItemSearchResults((array) $optionSlugs, $search); // get search results with option and items

 \afzalroq\cms\entities\front\Options::getOptionSearchResults((array) $optionSlugs, $search); // get search results with options

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1986d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a5eee860256c2f0d9e30c63f6f88fe13eb42e41f0d16ce9b22b47af51238f83?d=identicon)[Dilshoddeveloper](/maintainers/Dilshoddeveloper)

---

Top Contributors

[![Abdualiym](https://avatars.githubusercontent.com/u/10773154?v=4)](https://github.com/Abdualiym "Abdualiym (143 commits)")[![Azam2926](https://avatars.githubusercontent.com/u/28877486?v=4)](https://github.com/Azam2926 "Azam2926 (50 commits)")[![Elnurrabbimov](https://avatars.githubusercontent.com/u/50526559?v=4)](https://github.com/Elnurrabbimov "Elnurrabbimov (45 commits)")[![sarvar-akbarov](https://avatars.githubusercontent.com/u/56576654?v=4)](https://github.com/sarvar-akbarov "sarvar-akbarov (41 commits)")[![RuzimurodovDilshodbek](https://avatars.githubusercontent.com/u/75004003?v=4)](https://github.com/RuzimurodovDilshodbek "RuzimurodovDilshodbek (18 commits)")[![afzalroq](https://avatars.githubusercontent.com/u/62251035?v=4)](https://github.com/afzalroq "afzalroq (10 commits)")[![Scarpion0990](https://avatars.githubusercontent.com/u/31815652?v=4)](https://github.com/Scarpion0990 "Scarpion0990 (9 commits)")[![MMEdeveloper](https://avatars.githubusercontent.com/u/84633956?v=4)](https://github.com/MMEdeveloper "MMEdeveloper (2 commits)")[![Azamat-yamin](https://avatars.githubusercontent.com/u/37281526?v=4)](https://github.com/Azamat-yamin "Azamat-yamin (2 commits)")[![DilmurodAxmadov](https://avatars.githubusercontent.com/u/59030669?v=4)](https://github.com/DilmurodAxmadov "DilmurodAxmadov (1 commits)")

---

Tags

frameworkcontentcmsyii2advanced

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dilshoddevoloper-yii2-cms-private/health.svg)

```
[![Health](https://phpackages.com/badges/dilshoddevoloper-yii2-cms-private/health.svg)](https://phpackages.com/packages/dilshoddevoloper-yii2-cms-private)
```

###  Alternatives

[luyadev/luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.

8086.9k2](/packages/luyadev-luya)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[funson86/yii2-adminlte

Yii 2 Advanced Application Template with Adminlte Theme

1492.2k](/packages/funson86-yii2-adminlte)[beaten-sect0r/yii2-core

Yii2 Core project template

771.1k](/packages/beaten-sect0r-yii2-core)

PHPackages © 2026

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