ezon/flashmessage
最新稳定版本:v1.0
Composer 安装命令:
composer require ezon/flashmessage
包简介
Message controller for ANAX-MVC
README 文档
README
FlashMessageControl
Hello there,
This is a result of a lesson in a school project.
Flash messages are used to inform the user about the state of the action he / she has made or simply displaying information to users. These types of messages can be generated using this component. Below you will find some examples of instant messaging with Font Awesome.
You can easily remove or add your own messages, but you must specify them in the flashmessages.css. This version is also used with Font Awesome which you can download via https://fortawesome.github.io/Font-Awesome/.
#Installation
- To install, I recommend composer.
- Add this line into composer.json file: "require": {"ezon/flashmessage": "dev-master"}
#Access the controller in your frontcontroller:
$di->setShared('flashMessages', function() use ($di){ $flashMessages = new Ezon\FlashMessage\FlashController($di); return $flashMessages; });
In the router you also need to add the css-stylesheet flashmessages.css. Make sure that the name in the css corresponds to the name in the addMessage function if you decide to add a new message.
#Add the route in your front controller:
// Test Route $app->router->add('', function() use ($app) {
$app->theme->setTitle("Flash messages");
$app->theme->addStylesheet('css/flashmessages.css');
$app->flashMessages->addMessage('<i class="fa fa-check"></i> CHECK!', 'success');
$app->flashMessages->addMessage('<i class="fa fa-info"></i> Information', 'info');
$app->flashMessages->addMessage('<i class="fa fa-exclamation-triangle"></i> Warning!', 'warning');
$app->flashMessages->addMessage('<i class="fa fa-exclamation-circle"></i> Something went wrong!', 'error');
//Adds the view to display the messages
$app->views->add('flash/flash', [ 'content' => $app->flashMessages->getFlashMessages(), ]);
});
Good luck! :)
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-08