ath400/cflash
Composer 安装命令:
composer require ath400/cflash
包简介
Class for flash messages
README 文档
README
By Daniel Svensson, athens400@hotmail.com
Set and get messages (error, success, notice, warning) in HTML div elements to/from session. CFormAnax is an example used with the Anax framework
How to use with ANAX
Set the CFlash service, in your frontcontroller for instance, by including the follwing:
$di->set('message', function() use ($di) {
$message = new \Ath400\Flash\CFlashAnax();
$message->setDI($di);
return $message;
});
CFlash does not start the session, you have to do that yourself.
Messages are set like so:
$app->message->error('Some message');
$app->message->success('Some message');
$app->message->notice('Some message');
$app->message->warning('Some message');
Only one message is stored at a time. Meaning you only have to get one message which, depending on user action and controller responsible for calling the message methods, will output an error, success, notice or warning message.
Get the message:
$message = $app->message-getMessage();
You can also include the stylesheet located in webroot/css-folder to give the message-boxes different colors.
License
This software is free software and carries a MIT license
History
v1.0.0 (2015-04-29)
- First release
.
..: Copyright (c) 2015 Daniel Svensson, athens400@hotmail.com
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-17