blanchonvincent/super-messenger
Composer 安装命令:
composer require blanchonvincent/super-messenger
包简介
ZF2 module v1.0.1 - Boost your FlashMessenger !
README 文档
README
Version 1.0.1 Created by Vincent Blanchon
/!\ This module is now a PR to Zend Framework 2 : https://github.com/zendframework/zf2/pull/3502. Give me your feedback !
Introduction
ZF2 SuperMessenger module provide new features for plugin FlashMessenger. Now, you can add directly 3 level of messages : success message, error message or info message.
Usage
• Usage in controller :
$this->flashMessenger()->addInfoMessage('bar-info'); $this->flashMessenger()->addSuccessMessage('bar-success'); $this->flashMessenger()->addErrorMessage('bar-error');
Just active the module and the FlashMessenger will have features without BC ! You can use SuperMessenger by the identifier "FlashMessenger" with the alias. You could use the identifier "SuperMessenger" to pilot the plugin.
• Usage in view :
And to be complete, there is a view helper. Usage in a view to get list of messages :
<?php $infoMessages = $this->flashMessenger('info'); ?>
You can directly have a render of the messages :
<?php echo $this->flashMessenger()->render('info'); ?>
By default, the format is :
<ul class="info"> <li>first message</li> <li>second message</li> </ul>
You can change the format, like this :
<?php echo $this->flashMessenger() ->setMessageOpenFormat('<div%s><p>') ->setMessageSeparatorString('</p><p>') ->setMessageCloseString('</p></div>') ->render('info'); ?>
Format could be changed in supermessenger.local.php which will be moved in "/config/autoload" :
'view_helper' => array( 'supermessenger' => array( 'message_open_format' => '<div%s><ul><li>', 'message_separator_string' => '</li><li>', 'message_close_string' => '</li></ul></div>', ), ),
You can change easily the class CSS with :
<?php echo $this->flashMessenger()->render('info', array('foo-baz', 'foo-bar')); ?>
<ul class="foo-baz foo-bar"> <li>first message</li> <li>second message</li> </ul>
blanchonvincent/super-messenger 适用场景与选型建议
blanchonvincent/super-messenger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.6k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2012 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 blanchonvincent/super-messenger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 blanchonvincent/super-messenger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-12-07