onmotion/yii2-page-assessments
Composer 安装命令:
composer require onmotion/yii2-page-assessments
包简介
Page assessment feature for your Yii2 application based on Vue2.
README 文档
README
The page assessment (polls) module for Yii2 framework based on Vue2.
Fluent view:
Static (embeded in a page) view:
Installation
Just run:
composer require onmotion/yii2-page-assessments
or add
"onmotion/yii2-page-assessments": "*"
to the require section of your composer.json file.
apply migration:
php yii migrate --migrationPath=@vendor/onmotion/yii2-page-assessments/migrations
Usage
You must add to your config:
'modules' => [ //... 'assessments' => [ 'class' => 'onmotion\assessments\Module', ], //... ],
Then you can use the widget somewhere on the page:
Example:
echo \onmotion\assessments\widget\AssessmentWidget::widget([ 'fluent' => false, // static or fluent view // 'timeout' => 1500 // timeout bafore appearance. 'questions' => [ 'Is this page helpful?', // simple question [ 'title' => 'What do you think about it?', 'maxValue' => 6, // 'allowComment' => true // allow optional comment 'allowComment' => [1, 2, 3], // allow comment only if value is 1, 2 or 3. // 'model' => (new SomeActiveRecordModel), // 'repeat' => true, // whether to force repeat the question // 'afterVoteText' => [ // show comment after got a vote (string || array) // 1 => 'It\'s ok! 👌', // 2 => 'Could be better 😎', // 3 => 'So so...', // 4 => 'Very good!', // 5 => 'Perfect!', // ] ] ] ]);
Options
| option | type | default | description |
|---|---|---|---|
| fluent | bool | false | fluent or static view |
| questions | string || array | see example | |
| timeout | integer | 1500 | timeout bafore appearance |
| model (optional) | ActiveRecord | null | Attach Model::class info with primary key |
| icons | array | [] | custom icons |
Events
assessment.show - when an assessment item appears.
assessment.end - when all questions are completed.
document.addEventListener('assessment.show', function (e) { console.log(e.detail); }, false);
You can change icons as you want, for example:
echo \onmotion\assessments\widget\AssessmentWidget::widget([ 'fluent' => true, 'questions' => $questions, 'icons' => [ 1 => '<span class="assessment-icon"><span class="assessment-icon__angry"></span></span>', 2 => '<span class="assessment-icon"><span class="assessment-icon__sad"></span></span>', 3 => '<span class="assessment-icon"><span class="assessment-icon__thinking"></span></span>', 4 => '<span class="assessment-icon"><span class="assessment-icon__happy"></span></span>', 5 => '<span class="assessment-icon"><span class="assessment-icon__in-love"></span></span>', ] ]);
onmotion/yii2-page-assessments 适用场景与选型建议
onmotion/yii2-page-assessments 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 1.09k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「extension」 「widget」 「Rating」 「votes」 「yii2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 onmotion/yii2-page-assessments 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 onmotion/yii2-page-assessments 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 onmotion/yii2-page-assessments 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
Adds more BBCode
统计信息
- 总下载量: 1.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-12

