abdualiym/yii2-text

Yii2 文本扩展

该软件包的官方仓库似乎已删除,因此该软件包已被冻结。

安装: 151

依赖者: 1

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:yii2-extension

1.1.4 2018-09-19 13:19 UTC

README

该扩展允许构建多语言滑块。

安装

  • 使用 composer 安装
composer require abdualiym/yii2-text
  • 在执行 composer install 后,运行控制台命令以创建表格
php yii migrate/up --migrationPath=@vendor/abdualiym/yii2-text/migrations
  • 添加到后端配置文件
'controllerMap' => [
    'categories' => [
        'class' => 'abdualiym\text\controllers\CategoryController',
    ],
    'text' => [
        'class' => 'abdualiym\text\controllers\TextController',
    ],
],
  • 添加到公共配置文件
'i18n' => [
    'translations' => [
        'text' => [
            'class' => 'yii\i18n\PhpMessageSource',
            'basePath' => '@vendor/abdualiym/yii2-text/messages',
            'sourceLanguage' => 'en',
            'fileMap' => [
                'text' => 'text.php',
            ],
        ],
    ]
],