方法:addCaptcha($name, $id = '', $title = '', $attr = [], $extra_attr_input = '', $extra_class_input = 'col-xs-10 col-sm-5', $extra_css_input = '', $extra_attr_img = '', $extra_class_img = 'col-xs-10 col-sm-3', $extra_css_img = 'cursor: pointer;border: 1px solid #d5d5d5;height:34px;margin-left:10px;')

标识符:captcha

参数 含义 类型
name 表单name string
id 验证码标识 string
title 表单标签 string
attr 属性 array
extra_attr_input input额外属性 string
extra_class_input input额外class string
extra_css_input input额外style string
extra_attr_img img额外属性 string
extra_class_img img额外class string
extra_css_img img额外style string

返回:Widget

$widget = new Widget();
return $widget
       ->addItem('captcha', 'verify','','验证码', [], 'required')
       ->setUrl(url('newsSave'))
       ->setAjax('ajaxForm-noJump')
       ->fetch();

验证码