ath400/cflash 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ath400/cflash

Composer 安装命令:

composer require ath400/cflash

包简介

Class for flash messages

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-17