heimrichhannot/contao-alert-reminder-bundle
Composer 安装命令:
composer require heimrichhannot/contao-alert-reminder-bundle
包简介
This utility bundle offers functionality to remind the backend users of existing alerts in the Contao CMS.
关键字:
README 文档
README
This utility bundle offers functionality to remind the backend users of existing alerts in the Contao CMS.
Features
- looks for existing (configurable) contao backend alerts (added via the hook
getSystemMessages) and adds a backend message in order to remind the backend user of it
Use case
You might ask what's the use case of this functionality?
The original use case was in order to remind the backend users to add missing alt attributes to images (accessibility).
Without the functionality, the user might forget about it. Making the alt mandatory has also not been an option because of contao's simple file upload functionality which doesn't contain the field at all.
Hence the need for reminding the backend user of it.
Installation
- Run
composer require heimrichhannot/contao-alert-reminder-bundleand update the database.
Technical instructions
Add new contao alerts to the context of this bundle
-
Register a
getSystemMessageshook as usual in contao:// config.php (or use yaml tags in contao 4.9+) $GLOBALS['TL_HOOKS']['getSystemMessages']['myBundle'] = [ \Acme\MyBundle\EventListener\GetSystemMessagesListener::class, '__invoke' ];
// GetSystemMessagesListener.php namespace Acme\MyBundle\EventListener; use Acme\AlertReminderBundle\Manager\AlertReminderManager; use Acme\RequestBundle\Component\HttpFoundation\Request; use Symfony\Contracts\Translation\TranslatorInterface; class GetSystemMessagesListener { /** * @var TranslatorInterface */ private $translator; /** * @var Request */ private $request; /** * @var AlertReminderManager */ private $alertReminderManager; public function __construct(AlertReminderManager $alertReminderManager, TranslatorInterface $translator, Request $request) { $this->translator = $translator; $this->request = $request; $this->alertReminderManager = $alertReminderManager; } public function __invoke() { $message = '<p class="tl_error">My alert message</p>'; return $this->alertReminderManager->prepareSystemMessage($message, 'some_alert_type_alias'); } }
-
In order to activate the reminding you have to add your alert type in your project's
app/config/config.yml:huh_alert_reminder: alert_types: - { name: some_alert_type_alias }
Add your alerts to the alert queue backend module
This bundle introduces the AlertQueueModule. It's just a list of messages. You might use it to add the full list of
alerts you want to the user to notice. In the context of reminding the user of missing alt-attributes this is the place
to add shortcuts to the concrete media files.
You can add your messages by registering an event listener for the event AddAlertsToAlertReminderQueueEvent for example as follows:
public function __invoke(AddAlertsToAlertReminderQueueEvent $event) { if ('alt_issues_existing' !== Input::get('type')) { return; } $messages = $event->getAlerts(); $messages[] = [ 'class' => 'tl_error', // you can use Contao's tl_ classes 'message' => 'My message' ]; $event->setAlerts($messages); }
heimrichhannot/contao-alert-reminder-bundle 适用场景与选型建议
heimrichhannot/contao-alert-reminder-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.5k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「alerts」 「contao」 「reminders」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 heimrichhannot/contao-alert-reminder-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heimrichhannot/contao-alert-reminder-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 heimrichhannot/contao-alert-reminder-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
Lipscore - Supercharged Ratings and Reviews
Calendar and event management for Laravel Enso
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A Laravel package for managing user invitations with polymorphic relationships, token-based access, scheduled reminders, and event-driven notifications.
Liberu Calendar
统计信息
- 总下载量: 1.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-08-06