tomas/message
Composer 安装命令:
composer require tomas/message
包简介
Message handling plugin
README 文档
README
This is a simple Message plugin that will store message via Session and display it for a given interval. Support for several message bubbles.
- Include
- message.js
- message.css
- Message.php
- Include the file wherever you may want to start a message and also where you want to output message.
##Simple SET and GET
- setMessage(your message)
- accepts array only
- ['type', 'msg']
- Type either "ok" or "error"
- Msg the wanted message to display
- getMessage() *outputs the message
##Use with Anax-MVC
- Js and Css files
- message.js
- put into webroot/js
- include that JS-file in your Theme
- message.css
- put into webroot/css
- include that CSS-file in your Theme
- PHP file
- Change Namespace in Message.php file
- Load Message.php in CDIFactory
- Create custom CDIFactory
<?php namespace -Your namespace- use Anax\DI\CDIFactoryDefault; use tomas\Message\Message; class CDIFactory extends CDIFactoryDefault { public function __construct() { parent::__construct(); $this->set('message', function() { $message = new Message(); return $message; }); } } ?>
- Change file "config_with_app.php"
- Change to CDIFactory instead of default
- Add $app->session();
- index.php (or choosen router)
- furthest down, under "$app->theme->render();" add "$app->message->getMessage()"
Drop me a mail tomas.sjosten@gmail.com if you want to give me some feedback.
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-19