缩略图对象
API - Core_Captcha
- Captcha::$config
- Captcha::valid
- Captcha::valid_count - Gets or sets the number of valid Captcha responses for this session.
- Captcha::promoted - Checks whether user has been promoted after having given enough valid responses.
- Captcha::render - render image
Gets or sets the number of valid Captcha responses for this session.
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
$new_count |
integer |
New counter value | null |
$invalid |
boolean |
Trigger invalid counter (for internal use only) | bool false |
integer
counter valueChecks whether user has been promoted after having given enough valid responses.
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
$threshold |
integer |
Valid response count threshold | null |
boolean
render image
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
$config |
array |
$config | bool false |
image
Generates a new captcha challenge.
string
the challenge answerCreates an image resource with the dimensions specified in config. If a background image is supplied, the image dimensions are used.
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
$background |
string |
Path to the background image file | null |
void
Fills the background with a gradient.
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
$color1 |
resource |
Gd image color identifier for start color | |
$color2 |
resource |
Gd image color identifier for end color | |
$direction |
string |
Direction: 'horizontal' or 'vertical', 'random' by default | null |
void
Returns the img html element or outputs the image to the browser.
mixed
html string or void