\WechatLoader

微信SDK加载器

Summary

Methods
Properties
Constants
register()
get_instance()
get()
config()
$callback
No constants found
No protected methods found
$config
$cache
N/A
No private methods found
No private properties found
N/A

Properties

$callback

$callback : array

事件注册函数

Type

array

$config

$config : array

配置参数

Type

array

$cache

$cache : array

对象缓存

Type

array

Methods

register()

register(string  $event, string  $method, string|null  $class = null) 

动态注册SDK事件处理函数

Parameters

string $event

事件名称(getAccessToken|getJsTicket)

string $method

处理方法(可以是普通方法或者类中的方法)

string|null $class

处理对象(可以直接使用的类实例)

get_instance()

get_instance(string  $type, array  $config = array()) : \Wechat\WechatCard|\Wechat\WechatCustom|\Wechat\WechatDevice|\Wechat\WechatExtends|\Wechat\WechatMedia|\Wechat\WechatMenu|\Wechat\WechatOauth|\Wechat\WechatPay|\Wechat\WechatPoi|\Wechat\WechatReceive|\Wechat\WechatScript|\Wechat\WechatService|\Wechat\WechatUser

获取微信SDK接口对象(别名函数)

Parameters

string $type

接口类型(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi)

array $config

SDK配置(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img)

Returns

\Wechat\WechatCard|\Wechat\WechatCustom|\Wechat\WechatDevice|\Wechat\WechatExtends|\Wechat\WechatMedia|\Wechat\WechatMenu|\Wechat\WechatOauth|\Wechat\WechatPay|\Wechat\WechatPoi|\Wechat\WechatReceive|\Wechat\WechatScript|\Wechat\WechatService|\Wechat\WechatUser

get()

get(string  $type, array  $config = array()) : \Wechat\WechatCard|\Wechat\WechatCustom|\Wechat\WechatDevice|\Wechat\WechatExtends|\Wechat\WechatMedia|\Wechat\WechatMenu|\Wechat\WechatOauth|\Wechat\WechatPay|\Wechat\WechatPoi|\Wechat\WechatReceive|\Wechat\WechatScript|\Wechat\WechatService|\Wechat\WechatUser

获取微信SDK接口对象

Parameters

string $type

接口类型(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi)

array $config

SDK配置(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img)

Returns

\Wechat\WechatCard|\Wechat\WechatCustom|\Wechat\WechatDevice|\Wechat\WechatExtends|\Wechat\WechatMedia|\Wechat\WechatMenu|\Wechat\WechatOauth|\Wechat\WechatPay|\Wechat\WechatPoi|\Wechat\WechatReceive|\Wechat\WechatScript|\Wechat\WechatService|\Wechat\WechatUser

config()

config(array  $config = array()) : array

设置配置参数

Parameters

array $config

Returns

array