ZF2表单操作
来源:互联网 发布:淘宝网苹果7都下架了 编辑:程序博客网 时间:2024/06/06 05:41
1.Date
1
2
3
4
5
6
7
8
//http://my.oschina.net/cart/
$this
->add(
array
(
'type'
=>
'Zend\Form\Element\Date'
,
'name'
=>
'birth'
,
'options'
=>
array
(
'label'
=>
'Birth'
)
));
1
2
3
4
5
6
7
$this
->add(
array
(
'type'
=>
'Zend\Form\Element\Date'
,
'name'
=>
'birth'
,
'options'
=>
array
(
'label'
=>
'Birth'
)
));
1
2
3
4
5
6
$this
->add(
array
(
'name'
=>
'id'
,
'attributes'
=>
array
(
'type'
=>
'hidden'
,
),
));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$this
->add(
array
(
'type'
=>
'Zend\Form\Element\MultiCheckbox'
,
'name'
=>
'hobby'
,
'options'
=>
array
(
'label'
=>
'Please choose one/more of the hobbies'
,
'value_options'
=>
array
(
'1'
=>
'Cooking'
,
'2'
=>
'Writing'
,
'3'
=>
'Others'
),
),
'attributes'
=>
array
(
'value'
=>
'1'
//set checked to '1'
)
));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$this
->add(
array
(
'type'
=>
'Zend\Form\Element\Radio'
,
'name'
=>
'direction'
,
'options'
=>
array
(
'label'
=>
'Please choose one of the directions'
,
'value_options'
=>
array
(
'1'
=>
'Programming'
,
'2'
=>
'Design'
,
),
),
'attributes'
=>
array
(
'value'
=>
'1'
//set checked to '1'
)
));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$this
->add(
array
(
'type'
=>
'Zend\Form\Element\Select'
,
'name'
=>
'gender'
,
'options'
=>
array
(
'label'
=>
'Gender'
,
'value_options'
=>
array
(
'1'
=>
'Select your gender'
,
'2'
=>
'Female'
,
'3'
=>
'Male'
),
),
'attributes'
=>
array
(
'value'
=>
'1'
//set selected to '1'
)
));
1
2
3
4
5
6
7
8
9
$this
->add(
array
(
'name'
=>
'name'
,
'attributes'
=>
array
(
'type'
=>
'text'
,
),
'options'
=>
array
(
'label'
=>
'Name'
,
),
));
1
2
3
4
5
$this
->formElementErrors()
->setMessageOpenFormat(
'<div%s><span>'
)
->setMessageCloseString(
'</span></div>'
)
->setMessageSeparatorString(
'</span><span>'
)
->setAttributes(
array
(
'class'
=>
'error'
));
0 0
- ZF2表单操作
- ZF2常用的操作
- ZF2开发中常用操作
- ZF2开发中常用操作
- Zend Framework 2.0 (zf2) 进阶数据库操作
- 使用ZF2的DI操作Zend\Mail发送邮件
- 学习zf2
- ZF2搭建
- ZF2开发中常用操作 - zend framework 2 开发实战中常用操作最热门30问
- 安装ZF2问题
- zf2 禁用layout
- zf2 增加模板
- zf2 路由跳转方法
- zf2相关资料
- 单元测试一个ZF2应用程序
- zf2分析:Zend\ServiceManager
- PHPExcel整合到ZF2
- zf2 redis 练手2
- 快速上手RaphaelJS--RaphaelJS_Starter翻译(三)
- 扩展 ZF2 Redis Zend Framework 2 Redis Extend - key正则
- 最长重复数组
- Open XML SDK 现已经由 GitCafe 登陆中国开源社区
- 日语学习之沪江N4基础 20141201
- ZF2表单操作
- mysql存储过程
- iOS学习--UIScrollView 原理详解
- duplicateMovieClip
- 西门子PLC学习笔记十-(计数器)
- sip参考大全
- MySQL 复制简要描述及示例
- 浏览器兼容性问题,欢迎大家补充!
- removeMovieClip