grozzzny/catalog

Catalog module for Yii2

Installs: 476

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v3.0 2020-07-07 01:05 UTC

This package is auto-updated.

Last update: 2024-11-17 22:41:15 UTC


README

This module allows to yii2

Installation guide

$ php composer.phar require grozzzny/catalog "v3.x-dev"

Run migrations

php yii migrate --migrationPath=@vendor/grozzzny/catalog/migrations

Or add following lines to your console configuration file:

'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationPath' => [
            '@grozzzny/catalog/migrations',
        ],
    ],
],
'modules' => [
    'catalog' => [
        'class' => 'grozzzny\catalog\CatalogModule',
    ],
],
'i18n' => [
    'translations' => [
        'catalog' => [
            'class' => 'yii\i18n\PhpMessageSource',
            'sourceLanguage' => 'en-US',
            'basePath' => '@grozzzny/catalog/messages',
        ],
    ],
],
'container' => [
    'singletons' => [
        'grozzzny\catalog\models\Category' => ['class' => 'app\models\Category'],
    ],
],

Schema

alt text

Catalog with different types of data

alt text

Any level of nesting

alt text

Speed filter

alt text alt text

Several languages

<?
$i18n = json_encode([
    'select_category' => Yii::t('catalog','Select category..'),
    'key' => Yii::t('catalog','Key'),
    'value' => Yii::t('catalog','Value'),
    ...
    'filter_show' => Yii::t('catalog','Show in filter'),
], JSON_UNESCAPED_UNICODE);

Element "Many to Many"

alt text

Inheritability of properties

alt text alt text

Large selection of property types

alt text

Convenient setting options for a property with the type "select"

alt text

Easily add customizations

if ($property->settings->filter_range){
  ...
}

alt text

Universal validation rules

alt text alt text

Property type "Multi category"

alt text alt text alt text

Property type "HTML"

alt text

Property type "Image" or "File"

alt text

Property type "Code"

alt text