ilyaserdyuk/notices
Composer 安装命令:
composer require ilyaserdyuk/notices
包简介
Notices for Zend Framework 2/3
README 文档
README
Extension for displaying messages in Zend Framework 2/3 and Twitter bootstrap 3 applications.
Installation
Use Composer:
$ composer require ilyaserdyuk/notices:^1.0
And add to layout:
<?= $this->notices() ?>
How use
Send messages from the controllers:
class IndexController extends AbstractActionController { public function indexAction() { $this->notices()->addSuccessMessage('You successfully read this important alert message.'); $this->notices()->addInfoMessage('This alert needs your attention, but it\'s not super important.'); $this->notices()->addWarningMessage('Better check yourself, you\'re not looking too good.'); $this->notices()->addErrorMessage('Change a few things up and try submitting again.'); } }
Output:
<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Well done!</strong> You successfully read this important alert message. </div> <div class="alert alert-info alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Heads up!</strong> This alert needs your attention, but it's not super important. </div> <div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Warning!</strong> Better check yourself, you're not looking too good. </div> <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Oh snap!</strong> Change a few things up and try submitting again. </div>
How to configure
You can customize the output template, turn off escaping and change the label of messages. To do this, add to config file (config/autoload/global.php):
return [ 'view_helper_config' => [ 'notices' => [ 'auto_escape' => true, 'template_string' => '<div class="alert alert-{class} alert-dismissible" role="alert">{text}</div>', 'label_for_status' => [ Message::CLASS_SUCCESS => 'Успешно:', Message::CLASS_INFO => 'Информация:', Message::CLASS_WARNING => 'Предупреждение:', Message::CLASS_ERROR => 'Ошибка:', ], ], ], ];
ilyaserdyuk/notices 适用场景与选型建议
ilyaserdyuk/notices 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 07 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 「mvc」 「zf3」 「notices」 「messager」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ilyaserdyuk/notices 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ilyaserdyuk/notices 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ilyaserdyuk/notices 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
Kinikit - PHP Application development framework MVC component
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Zend Framework module to leverage the symfony dependency injection container
RCM User HTML views/pages
Builds a Bridge between Zend Expressive and Plugin Managers of Zend\MVC
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-21