erogami/cfmessage
Composer 安装命令:
composer require erogami/cfmessage
包简介
Class for flash messages
README 文档
README
Cfmessage
Flash messages, a class to show sucess, info, warning and error messages for the user.
By Alex Chau, alex_chau6@hotmail.com
Instructions
###1. Download
First of all install by using composer. Add this code to your composer.json:
"require": { "erogami/cfmessage": "dev-master" },
###2. Include Cfmessage in your framework
Add this code to your front-controller.
$di->set('Cfmessage', function() use ($di) { $message = new \erogami\Cfmessage\Cfmessage($di); return $message; });
Now add these lines to get your message.
For info messages:
$app->Cfmessage->addInfo('This is an information message');
For error messages:
$app->Cfmessage->addError('This is an error message');
For warning messages:
$app->Cfmessage->addWarning('This is a warning message');
For success messages:
$app->Cfmessage->addSuccess('This is a success message');
The messages will be saved in the session, call these lines to print out the messages:
$messages = $app->Cfmessage->printMessage(); $app->views->addString($messages);
The class uses Font Awesome, but works without it too. So it's optional wheter you want to include the icons or not.
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-13