grozzzny/catalog

Yii2 的目录模块

安装: 476

依赖者: 3

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

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

This package is auto-updated.

Last update: 2024-09-17 22:19:32 UTC


README

此模块允许yii2

安装指南

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

运行迁移

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

或者将以下行添加到您的控制台配置文件中

'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'],
    ],
],

模式

alt text

包含不同类型数据的目录

alt text

任意级别的嵌套

alt text

速度过滤器

alt text alt text

多种语言

<?
$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);

"多对多"元素

alt text

属性的继承性

alt text alt text

丰富的属性类型选择

alt text

为类型为"选择"的属性提供方便的设置选项

alt text

轻松添加自定义

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

alt text

通用的验证规则

alt text alt text

属性类型"多分类"

alt text alt text alt text

属性类型"HTML"

alt text

属性类型"图像"或"文件"

alt text

属性类型"代码"

alt text