文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>CakePHP 1.2 FormHelper Examples

CakePHP 1.2 FormHelper Examples

时间:2007-11-13  来源:liuxingyuyuni


CakePHP 1.2 FormHelper Examples
Posted here are live examples. Both the generated code and the rendered examples are running live on this server.
create
You write this …
create('Model',array('default' => false)); ?>
… and CakePHP returns this …
… which begins your form.
end
You write this …
end();?>; ?>
… and CakePHP returns this …
… which ends your form.
label
You write this …
label('Contacts.firstName','First Name',null); ?>
… and CakePHP returns this …
First Name
… which renders (as I have it styled) as this:
First Name
input
You write this …
input('firstName'); ?>
… and CakePHP returns this …
FirstName
… which renders (as I have it styled) as this:
FirstName
inputs
You write this …
inputs(array('firstName','lastName','middleName'),array('middleName')); ?>
… and CakePHP returns this …
New ContactsFirstNameLastName
… which renders (as I have it styled) as this:
New Contacts
FirstName
LastName
checkbox
You write this …
checkbox('Contacts.firstName'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:

radio
You write this …
radio('Contacts.firstName',array('yes','no')); ?>
… and CakePHP returns this …
yesno
… which renders (as I have it styled) as this:
yes
no
text
You write this …
text('Contacts.firstName'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
password
You write this …
password('Contacts.password'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
textarea
You write this …
textarea('Contacts.comments',array('rows'=>'10','cols'=>'50')); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
hidden
You write this …
hidden('Contacts.status'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
file
You write this …
file('Contacts.attached'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
submit
You write this …
submit('Submit'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
submitImage
You write this …
submitImage('cake.icon.png'); ?>
… and CakePHP returns this …
… which renders (as I have it styled) as this:
select
You write this …
select('Contacts.type',array('vendor'=>'vendor','subcontractor'=>'subcontractor','employee'=>'employee'),'vendor',null,false); ?>
… and CakePHP returns this …
vendor
subcontractor
employee
… which renders (as I have it styled) as this:
vendor subcontractor employee
day
You write this …
day('Day',null,null,false); ?>
… and CakePHP returns this …
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
… which renders (as I have it styled) as this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
year
You write this …
year('Year',2006,2017,null,null,false); ?>
… and CakePHP returns this …
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
… which renders (as I have it styled) as this:
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
month
You write this …
month('Month',null,null,false); ?>
… and CakePHP returns this …
January
February
March
April
May
June
July
August
September
October
November
December
… which renders (as I have it styled) as this:
January February March April May June July August September October November December
hour
You write this …
hour('Hour',true,null,null,false); ?>
… and CakePHP returns this …
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
… which renders (as I have it styled) as this:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
minute
You write this …
minute('Minute'); ?>
… and CakePHP returns this …
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
… which renders (as I have it styled) as this:
  00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
meridian
You write this …
meridian('Meridian'); ?>
… and CakePHP returns this …
am
pm
… which renders (as I have it styled) as this:
  am pm
dateTime
You write this …
dateTime('dateTime','DMY',24,null,null); ?>
… and CakePHP returns this …
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-
January
February
March
April
May
June
July
August
September
October
November
December
-
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
:
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
… which renders (as I have it styled) as this:
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-
  January February March April May June July August September October November December
-
  1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027   0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
:
  00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59


相关阅读 更多 +
排行榜 更多 +
模拟梦幻人生 v2.0.1 安卓版

模拟梦幻人生 v2.0.1 安卓版

飞行射击 下载
模拟梦幻人生 v2.0.1 安卓版

模拟梦幻人生 v2.0.1 安卓版

飞行射击 下载
模拟梦幻人生 v2.0.1 安卓版

模拟梦幻人生 v2.0.1 安卓版

飞行射击 下载