afzalroq/yii2-unit
Composer 安装命令:
composer require afzalroq/yii2-unit
包简介
Yii2 unit extension
关键字:
README 文档
README
The extension allows manage block of html contents, files, images.
Installation
- Install with composer:
composer require afzalroq/yii2-unit "^1.1"
- After composer install run console command for create tables:
php yii migrate/up --migrationPath=@vendor/afzalroq/yii2-unit/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' => [ 'unit' => [ // don`t change module key 'class' => '@afzalroq\unit\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:
/unit/categories/index /unit/units/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
afzalroq\unit\entities\Unit::getBySlug($slug)
get each block data for current app language:
$units = Unit::getBySlug($slug);
foreach ($units as $unit) {
echo ($blockObject->getModelByType())->get();
}
TODO
- Copy from extension root directory example widgets for frontend integration
afzalroq/yii2-unit 适用场景与选型建议
afzalroq/yii2-unit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「html」 「blocks」 「yii2」 「info」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 afzalroq/yii2-unit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 afzalroq/yii2-unit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 afzalroq/yii2-unit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Blocks for NetCommons Plugin
A block that displays featured content - large image, title, description and link.
Flexslider slideshow content block for Silverstripe Elemental
A block to display a list of links to child pages, or pages in current level
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-09-18