* @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; } }