bajzany / notify
此包的最新版本(v2.0.1)没有可用的许可信息。
Nette 框架的通知控制
v2.0.1
2019-07-24 10:57 UTC
Requires
- php: ^7.2
- latte/latte: ^2.4
- nette/application: ^2.4
- nette/bootstrap: ^2.4
- nette/di: ^2.4
- nette/utils: ^2.4
- nettpack/stage: ^1.0
This package is auto-updated.
Last update: 2024-09-25 07:44:36 UTC
README
Nette 通知消息
要求
安装
-
Composer 安装
composer require bajzany/notify dev-master
-
注册到 Nette 应用程序
extensions: Notify: Bajzany\Notify\DI\NotifyExtension
-
如何使用
-
在 presenter notifyTrait 中;
use NotifyTrait;
-
添加到通知集合
$this->addNotify('Second notification', 'NotifyControl', Notification::TYPE_PURPLE);
-
模板 (.latte) 在您的基 Latte 中
{control notify}
-
-
在 presenter 中创建 onAfterRender 可调用属性和函数 afterRender,其中放置了 notifyTrait。这很重要,因为在 Ajax 请求中必须启动 redrawControl 重新绘制控件。
/** * @var callable[] */ public $onAfterRender = []; protected function afterRender() { parent::afterRender(); $this->onAfterRender(); }