12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- 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';
- 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;
- }
- }
|