black-lamp / yii2-articles
此包的最新版本(0.8.2)没有提供许可证信息。
Yii框架的文章扩展
0.8.2
2020-04-15 08:01 UTC
Requires
- php: >=5.4.0
- 2amigos/yii2-tinymce-widget: *
- black-lamp/yii2-multi-lang: ^1.0.0
- black-lamp/yii2-seo: ^0.2
- kartik-v/yii2-widget-datepicker: *
- yii2tech/ar-position: *
- yiisoft/yii2: >=2.0.4
- yiisoft/yii2-bootstrap: *
This package is not auto-updated.
Last update: 2024-09-14 17:43:05 UTC
README
安装
Composer 需求部分
"black-lamp/yii2-articles": "0.*"
迁移
php yii migrate --migrationPath=@yii/rbac/migrations
php yii migrate --migrationPath=@vendor/black-lamp/yii2-multi-lang/migration
php yii migrate --migrationPath=@vendor/black-lamp/yii2-articles/common/migrations
php yii migrate --migrationPath=@vendor/black-lamp/yii2-seo/migrations
将文章模块添加到您的后端配置
'modules' => [ ... 'articles' => [ 'class' => 'bl\articles\backend\Module' ], ... ]
将文章模块添加到您的前端配置
'modules' => [ ... 'articles' => [ 'class' => 'bl\articles\frontend\Module' ], ... ]
配置 seo-url 规则
'urlManager' => [ ... 'rules' => [ ... [ 'class' => 'bl\articles\UrlRule' ] ] ]
配置 Imagable 模块
'components' => [ ... 'articles_imagable' => [ 'class' => bl\imagable\Imagable::className(), 'imageClass' => CreateImageImagine::className(), 'nameClass' => bl\imagable\name\CRC32Name::className(), 'imagesPath' => '@frontend/web/images', 'categories' => [ 'origin' => false, 'category' => [ 'thumbnail' => [ 'origin' => false, 'size' => [ 'big' => [ 'width' => 1500, 'height' => 500 ], 'thumb' => [ 'width' => 500, 'height' => 500, ], 'small' => [ 'width' => 150, 'height' => 150 ] ] ], 'menu_item' => [ 'origin' => false, 'size' => [ 'big' => [ 'width' => 1500, 'height' => 500 ], 'thumb' => [ 'width' => 500, 'height' => 500, ], 'small' => [ 'width' => 150, 'height' => 150 ] ] ], 'social' => [ 'origin' => true, 'size' => [ 'big' => [ 'width' => 1500, 'height' => 500 ], 'thumb' => [ 'width' => 500, 'height' => 500, ], 'small' => [ 'width' => 150, 'height' => 150 ] ] ], ] ] ], ]
使用
yourbackend.url/articles/article
**YOU MUST CONFIGURE IMAGABLE COMPONENT**
角色及其权限
articleManager
- viewArticleList
- editArticles
- deleteArticles
articleCategoryManager
- viewCategoryList
- editCategories
- deleteCategories
articleAdministrator 扩展了分类和文章管理员的权限。