aceer/message

PHP类,用于发送消息,可在Anax MVC中使用

v1.0 2015-06-25 14:53 UTC

This package is not auto-updated.

Last update: 2024-10-02 08:38:35 UTC


README

Build Status Build Status Build Status

这是一个使用PHP和JavaScript显示消息的类。与ANAX MVC一起使用。

您可以选择消息显示多长时间,或者是否一直显示。

=========== 用户指南

只需下载类并将其包含在PHP自动加载器中。之后创建类的新的对象,例如

$message = new /Aceer/Message/CMessage();

然后选择要发送的消息类型(成功、危险、警告、信息)。

$message->success("You have successfully logged in!");

您还可以指定消息显示多长时间后消失,如果输入了值,则消息不会消失。

$message->success("You have successfully logged in!",3000);
// 3000 = 3 seconds

有4种类型的消息可以发送

- danger
	CSS class = 'alert alert-danger';
- success 
	CSS class = 'alert alert-success';
- info 
	CSS class = 'alert alert-info';
- warning 
	CSS class = 'alert alert-warning';

使用Twitter Bootstrap css标准,但如果您想的话,也可以自定义默认的CSS类值

$message = new /Aceer/Message/CMessage(
	[
		"success" => "some css class",
		"danger" => "some css class",
		"warning" => "some css class",
		"info" => "some css class",
	]);