helikopterspark/flashmsg
Composer 安装命令:
composer require helikopterspark/flashmsg
包简介
Message controller for ANAX-MVC
关键字:
README 文档
README
FlashMessage
This is a module for the Anax-MVC web framework. The module has been developed as a part of a course on Blekinge Tekniska Högskola.
Flash messages are used to display status messages, results of actions or notices. Use this component to generate these types of messages.
The class FlashMsg uses the session service in Anax-MVC to store the messages until the array is cleared.
#Installation
- To install, use composer.
- Add this line into your composer.json file:
"require": {"helikopterspark/flashmsg": "dev-master"}
- Move or copy the css/flashmsg.css file to the webroot/css folder in your Anax-MVC installation. Modify it to your liking.
- In the router you also need to add the css-stylesheet flashmsg.css.
- You can move or copy the file flashmessages.php to your webroot to test in a web browser.
#Access the controller in your frontcontroller:
$di->setShared('flashmessage', function() use ($di){
$flashMessages = new \helikopterspark\FlashMsg\FlashMsg();
$flashMessages->setDI($di);
return $flashMessages;
});
#Add the route in your frontcontroller:
$app->router->add('', function() use ($app) {
$app->theme->addStylesheet('css/flashmsg.css');
$app->theme->setTitle("Flash messages");
$app->flashmessage->alert('Alert');
$app->flashmessage->error('Error');
$app->flashmessage->info('Info');
$app->flashmessage->notice('Notice');
$app->flashmessage->success('Success');
$app->flashmessage->warning('Warning');
$app->views->add('theme/index', ['content' => $app->flashmessage->outputMsgs()]);
$app->flashmessage->clearMessages();
});
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-15