mrstroz / yii2-wavecms
Yii2 WaveCMS
Requires
Requires (Dev)
- php: >=5.4.0
- yiisoft/yii2: ~2.0.6
- dev-master
- 0.2.14
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.5
- 0.1.4
- 0.1.3.2
- 0.1.3.1
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.1
- dev-dependabot/npm_and_yarn/asset/media/qs-6.3.3
- dev-dependabot/npm_and_yarn/asset/media/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/asset/media/minimist-1.2.6
- dev-dependabot/npm_and_yarn/asset/media/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/asset/media/tar-2.2.2
- dev-dependabot/npm_and_yarn/asset/media/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/asset/media/y18n-3.2.2
- dev-dependabot/npm_and_yarn/asset/media/ini-1.3.7
- dev-dependabot/npm_and_yarn/asset/media/node-sass-4.14.1
This package is auto-updated.
Last update: 2024-09-07 13:36:45 UTC
README
Yii2 WaveCMS
建议在 Yii 2 高级项目模板 上安装
安装
安装此扩展的首选方式是通过 composer。
运行
composer require --prefer-source "mrstroz/yii2-wavecms" "~0.2.5"
或添加
"mrstroz/yii2-wavecms": "~0.2.5"
到您的 composer.json
文件的 require 部分。
所需步骤
- 更新
backend/config/main.php
(Yii2 高级模板)
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'] ], ], // ... 'components' => [ // ... 'user' => [ 'identityClass' => 'mrstroz\wavecms\models\User', //Change identity class // ... ], ] // ... 'controllerMap' => [ 'elfinder' => [ 'class' => 'mihaildev\elfinder\Controller', 'access' => ['@'], 'disabledCommands' => ['netmount'], 'roots' => [ [ 'baseUrl'=>'@frontWeb', 'basePath'=>'@frontWebroot', 'path' => 'userfiles', 'name' => 'Files' ] ] ] ]
-
取消注释
urlManager
部分,并在backend/config/main.php
中添加 .htaccess -
更新
common/config/main.php
(Yii2 高级模板)
'components' => [ 'authManager' => [ 'class' => 'yii\rbac\DbManager', ], ]
- 运行迁移
在 console/config/main.php
中添加 migrationPath
并运行 yii migrate
// Add migrationPaths to console config: 'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationPath' => [ '@app/migrations', '@yii/rbac/migrations/', '@yii/i18n/migrations/', '@vendor/mrstroz/yii2-wavecms/migrations/', '@vendor/yii2mod/yii2-settings/migrations/' ], ], ],
或直接运行迁移
yii migrate --migrationPath=@yii/rbac/migrations
yii migrate --migrationPath=@yii/i18n/migrations/
yii migrate --migrationPath=@vendor/mrstroz/yii2-wavecms/migrations
yii migrate --migrationPath=@vendor/yii2mod/yii2-settings/migrations
- 更新
console/config/main.php
(Yii2 高级模板)
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module' ], ],
- 添加新的 WaveCMS 用户
yii wavecms/create [email] [password]
覆盖类
类可以通过
- WaveCMS 模块的
classMap
属性来覆盖
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'], 'classMap' => [ 'User' => \common\models\User::class ] ], ],
- 在
backend/config/main.php
中配置 Yii2 依赖注入
'container' => [ 'definitions' => [ mrstroz\wavecms\models\User::class => common\models\User::class ], ],
覆盖控制器
使用 WaveCMS 模块的 controllerMap
属性来覆盖控制器
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'], 'controllerMap' => [ 'user' => 'backend\controllers\UserController' ] ], ],
覆盖视图
使用 主题 来覆盖视图
'components' => [ // ... 'view' => [ 'theme' => [ 'basePath' => '@app/themes/basic', 'baseUrl' => '@web/themes/basic', 'pathMap' => [ '@wavecms/views' => '@app/themes/basic/wavecms', ], ], ], // ... ],
多语言
-
许多语言可以通过 yii2-localeurls 来处理。按照 Locale Urls 安装的所有步骤进行。
-
在
backend/config/main.php
中为 WaveCMS 模块设置 CMS 语言
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'] ], // ... ]
- 配置消息源 见文档
'components' => [ // ... 'i18n' => [ 'translations' => [ '*' => [ 'class' => 'yii\i18n\DbMessageSource', ], ], ], ],
- 使用
message
命令添加模板中添加的翻译
yii message/config-template path/to/config.php
yii message path/to/config.php
共享主机
对于 共享主机,从 vendor/mrstroz/wavecms
复制并替换 environments
文件夹,然后输入 php init
。前端 URL: /public
,后端 URL: /public/admin
可用的 WaveCMS 模块
页面(主页、文本页面、菜单)- https://github.com/mrstroz/yii2-wavecms-page
示例(示例模块)- https://github.com/mrstroz/yii2-wavecms-example
表单(表单模块)- https://github.com/mrstroz/yii2-wavecms-form
INWAVE - 互联网软件开发公司
inwave.eu