abdualiym/yii2-block 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

abdualiym/yii2-block

Composer 安装命令:

composer require abdualiym/yii2-block

包简介

Yii2 block extension

README 文档

README

The extension allows manage block of html contents, files, images.

Installation

  • Install with composer:
composer require abdualiym/yii2-block "^1.1"
  • After composer install run console command for create tables:
php yii migrate/up --migrationPath=@vendor/abdualiym/yii2-block/migrations
  • Setup in common config storage and language configurations.

language indexes related with database columns.

Admin panel tabs render by array values order.

Begin id param value from 0.

'modules' => [
    'block' => [ // don`t change module key
        'class' => '@abdualiym\block\Module',
        'storageRoot' => $params['staticPath'],
        'storageHost' => $params['staticHostInfo'],
        'thumbs' => [ // 'sm' and 'md' keys are reserved
            'admin' => ['width' => 128, 'height' => 128],
            'thumb' => ['width' => 320, 'height' => 320],
        ],
        'languages' => [
            'ru' => [
                'id' => 0,
                'name' => 'Русский',
            ],
            'uz' => [
                'id' => 1,
                'name' => 'English',
            ],
        ],
    ],
]
  • In admin panel add belove links for manage categories and blocks:
/block/categories/index
/block/block/index?slug=your_category_slug_name

For using BlockController actions you must manual specify their category slug in route.

Examples

Extension registers next language arrays to Yii::$app->params[] for use in views:

\Yii::$app->params['cms']['languageIds'][$prefix] = $language['id'];
[
    'en' => 2,
    'ru' => 1,
    ...
]

\Yii::$app->params['cms']['languages'][$prefix] = $language['name'];
[
    'en' => 'English',
    ...
]


\Yii::$app->params['cms']['languages2'][$language['id']] = $language['name'];
[
    2 => 'English',
    ...
]

Frontend widgets integration

get all blocks by category slug

abdualiym\block\entities\Blocks::getBySlug($slug)

get each block data for current app language:

$blocks = Blocks::getBySlug($slug);
foreach ($blocks as $block) {
    echo ($blockObject->getModelByType())->get();
}

TODO

  • Copy from extension root directory example widgets for frontend integration

统计信息

  • 总下载量: 222
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固