callmez\wechat\sdk\Wechat::createMenu PHP Method

createMenu() public method

创建菜单
public createMenu ( array $buttons ) : boolean
$buttons array 菜单结构字符串 ~~~ $this->createMenu([ [ 'type' => 'click', 'name' => '今日歌曲', 'key' => 'V1001_TODAY_MUSIC' ], [ 'type' => 'view', 'name' => '搜索', 'url' => 'http://www.soso.com' ] ... ]); ~~~
return boolean
    public function createMenu(array $buttons)
    {
        $result = $this->httpRaw(self::WECHAT_MENU_CREATE_URL . 'access_token=' . $this->getAccessToken(), ['button' => $buttons]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
Wechat