PHP Class daixianceng\smser\Smser

Author: Cosmo ([email protected])
Inheritance: extends yii\base\Component
Afficher le fichier Open project: daixianceng/yii2-smser Class Usage Examples

Méthodes publiques

Свойство Type Description
$fileMode boolean 是否启用文件模式
$url string 请求地址
$username string 用户名

Protected Properties

Свойство Type Description
$message string 状态信息
$password string 密码
$state string 状态码

Méthodes publiques

Méthode Description
getMessage ( ) : string 获取状态信息
getState ( ) : string 获取状态码
send ( string $mobile, string $content ) : boolean 发送短信
sendByTemplate ( string $mobile, mixed $data, number $id ) : boolean 发送模板短信
setPassword ( string $password ) 设置密码
setUseFileTransport ( boolean $value ) Whether to use file mode.

Private Methods

Méthode Description
_sendAsFile ( string $mobile, string $content ) : boolean 用于存储短信内容

Method Details

getMessage() public méthode

获取状态信息
public getMessage ( ) : string
Résultat string

getState() public méthode

获取状态码
public getState ( ) : string
Résultat string

send() public méthode

发送短信
public send ( string $mobile, string $content ) : boolean
$mobile string 对方手机号码
$content string 短信内容
Résultat boolean 短信是否发送成功

sendByTemplate() public méthode

发送模板短信
public sendByTemplate ( string $mobile, mixed $data, number $id ) : boolean
$mobile string 对方手机号码
$data mixed 键值对
$id number 模板id
Résultat boolean 短信是否发送成功

setPassword() public méthode

设置密码
public setPassword ( string $password )
$password string

setUseFileTransport() public méthode

Whether to use file mode.
public setUseFileTransport ( boolean $value )
$value boolean

Property Details

$fileMode public_oe property

是否启用文件模式
public bool $fileMode
Résultat boolean

$message protected_oe property

状态信息
protected string $message
Résultat string

$password protected_oe property

密码
protected string $password
Résultat string

$state protected_oe property

状态码
protected string $state
Résultat string

$url public_oe property

请求地址
public string $url
Résultat string

$username public_oe property

用户名
public string $username
Résultat string