Skip to content
This repository was archived by the owner on Sep 25, 2021. It is now read-only.

Files

Latest commit

 

History

History
executable file
·
46 lines (37 loc) · 784 Bytes

menu.md

File metadata and controls

executable file
·
46 lines (37 loc) · 784 Bytes

自定义菜单

自定义菜单是指为单个应用设置自定义菜单功能,所以在使用时请注意调用正确的应用实例。

$config = [
    'corp_id' => 'xxxxxxxxxxxxxxxxx',
    'secret'   => 'xxxxxxxxxx', // 应用的 secret
    //...
];
$app = Factory::work($config);

创建菜单

$menus = [
    'button' => [
        [
            'name' => '首页',
            'type' => 'view',
            'url' => 'https://easywechat.com'
        ],
        [
            'name' => '关于我们',
            'type' => 'view',
            'url' => 'https://easywechat.com/about'
        ],
        //...
    ],
];

$app->menu->create($menus);

获取菜单

$app->menu->get();

删除菜单

$app->menu->delete();