\orgAlisms

阿里大于SMS短信发送

调用示例: public function send() { $mobile = $this->request->post('mobile'); $template = $this->request->post('template'); $sign = $this->request->post('sign'); $param = (array) json_decode($this->request->post('param')); $alisms = new \org\Alisms(); $ret = $alisms->mobile($mobile) ->template($template) ->sign($sign) ->param($param) ->send(); if ($ret) { $this->success("发送成功"); } else { $this->error("发送失败!失败原因:" . $alisms->getError()); } }

配置信息: return array ( 0 => array ( 'name' => 'key', 'title' => '应用key', 'type' => 'string', 'content' => array ( ), 'value' => 'your key', 'rule' => 'required', 'msg' => '', 'tip' => '', 'ok' => '', 'extend' => '', ), 1 => array ( 'name' => 'secret', 'title' => '密钥secret', 'type' => 'string', 'content' => array ( ), 'value' => 'your secret', 'rule' => 'required', 'msg' => '', 'tip' => '', 'ok' => '', 'extend' => '', ), 2 => array ( 'name' => 'sign', 'title' => '签名', 'type' => 'string', 'content' => array ( ), 'value' => 'your sign', 'rule' => 'required', 'msg' => '', 'tip' => '', 'ok' => '', 'extend' => '', ), );

Summary

Methods
Properties
Constants
__construct()
instance()
sign()
param()
template()
mobile()
send()
getError()
$error
No constants found
No protected methods found
$config
N/A
_params()
percentEncode()
_signed()
_curl()
$_params
N/A

Properties

$error

$error : 

Type

$config

$config : 

Type

$_params

$_params : 

Type

Methods

__construct()

__construct(  $options = array()) 

Parameters

$options

instance()

instance(array  $options = array()) : \org\Alisms

单例

Parameters

array $options

参数

Returns

\org\Alisms

sign()

sign(string  $sign = '') : \org\Alisms

设置签名

Parameters

string $sign

Returns

\org\Alisms

param()

param(array  $param = array()) : \org\Alisms

设置参数

Parameters

array $param

Returns

\org\Alisms

template()

template(string  $code = '') : \org\Alisms

设置模板

Parameters

string $code

短信模板

Returns

\org\Alisms

mobile()

mobile(string  $mobile = '') : \org\Alisms

接收手机

Parameters

string $mobile

手机号码

Returns

\org\Alisms

send()

send() : boolean

立即发送

Returns

boolean

getError()

getError() : array

获取错误信息

Returns

array

_params()

_params() 

percentEncode()

percentEncode(  $string) 

Parameters

$string

_signed()

_signed(  $params) 

Parameters

$params

_curl()

_curl(  $params) 

Parameters

$params