方法:addItems($items=[])

参数 含义 类型
items 表单项数组 array

每个数组元素结构[$type,...]

返回:Widget

$widget=new Widget();
$items=[
         ['text','title','文章标题','','','required','text',['placeholder'=>'必填:文章标题']],
         ['text','stitle','短标题','','','required','text',['placeholder'=>'短标题']]
       ];
return $widget
       ->addItems($items)
       ->setUrl(url('newsSave'))
       ->setAjax('ajaxForm-noJump')
       ->fetch();

等同于

$widget=new Widget();
return $widget
       ->addItem('text','title','文章标题','','','required','text',['placeholder'=>'必填:文章标题'])
       ->addItem('text','stitle','短标题','','','required','text',['placeholder'=>'短标题'])
       ->setUrl(url('newsSave'))
       ->setAjax('ajaxForm-noJump')
       ->fetch();

批量添加表单项