sh / flash
用于显示闪存消息的插件。
v1.0
2015-04-09 17:01 UTC
Requires
- php: >=5.4
This package is not auto-updated.
Last update: 2024-09-28 17:54:27 UTC
README
FlashMessage
此模块用于在项目中显示闪存消息。
要使用此模块,需要在frontcontroller中添加以下代码。
$di->setShared('flash', function() { $flash = new \Anax\FlashMessage\FlashMessage(); return $flash; });
如果要保持代码一致性,也可以在src/DI中的CDIFactoryDefault中添加。它应该这样添加。
$this->setShared('flash', function() { $flash = new \Anax\FlashMessage\FlashMessage(); return $flash; });
要使用闪存消息,请在您的项目中添加以下行。
$app->flash->message('information', 'This is a info message'); $app->flash->message('warning', 'This is a warning message'); $app->flash->message('success', 'This is a success message'); $app->flash->message('error', 'This is a error message');
这将生成在视图中显示的HTML代码。
闪存消息的样式可以在flash.css文件中更改。