ernb14/cflash
Composer 安装命令:
composer require ernb14/cflash
包简介
Flash message class for Anax-MVC
关键字:
README 文档
README
With CFlash you can customize your own flash messages easy. With five pre defined flash message types it is very easy to install. You can also create your own personal ones.
License
This software is free software and carries a MIT license.
Installation
To install with Composer and Packagist:
"ernb14/cflash": "dev-master"
How to use flash messages
Firs you need to add this shared service in to your page controller.
$di->setShared('flash', function() use ($di) { $flashmessage = new \CFlash\CFlash\CFlash(); $flashmessage->setDI($di); return $flashmessage; });
Then you need to copy the images and css file in to your img and css paths. So you need to go to your theme root path like this:
cd your-theme
cp vendor/ernb14/CFlash/src/CFlash/css/CFlash.css webroot/css
cp -r vendor/ernb14/CFlash/src/CFlash/img/flash webroot/img
Now you only have to put this out in a route:
Example message $app->flash->CustomMessage('Godkänt', 'success'); and to display the message use $messages = $app->flash->displayFlashMessages(); and $app->views->addString($messages); to retrive the messages.
Pre defined messages
This class includes five pre defined messages. And those are 'error', 'success', 'info', 'warning', 'notice'. Here is and example of how you can use one: $app->flash->CustomMessage('Felmeddelenade', 'error');
To create a new message you can do this $app->flash->CustomMessage('Your message', 'message type'); which the type defines the css class that you can modify.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-01