12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * WeiXinMenuConst.php UTF-8
- * huosdk_mini_program
- *
- * @date : 2018/9/26 15:26
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : chenbingling <cbl@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huolib\constant;
- class WeiXinMenuConst {
- CONST IS_MENU_1 = 1; //不是微信菜单
- CONST IS_MENU_2 = 2; //微信菜单
- CONST MENU_TYPE_CLICK = 'click'; //点击回复关键词类型
- CONST MENU_TYPE_VIEW = 'view'; //跳转url类型
- CONST MENU_TYPE_MP = 'miniprogram'; //小程序类型
- public static function getMenuTypeMsg($type, $all = false) {
- $_msg = array(
- self::MENU_TYPE_CLICK => '点击回复类型',
- self::MENU_TYPE_VIEW => '跳转url类型',
- self::MENU_TYPE_MP => '跳转小程序',
- );
- if (true == $all) {
- return $_msg;
- }
- if (!isset($_msg[$type])) {
- return false;
- }
- return $_msg[$type];
- }
- public static function getMenuType($inc = false) {
- $_types = self::getMenuTypeMsg(null, true);
- if (true == $inc) {
- $_default = ["0" => "选择类型"];
- $_types = $_default + $_types;
- }
- return $_types;
- }
- }
|