forked from CakeDC/users
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ctp
More file actions
28 lines (27 loc) · 1007 Bytes
/
Copy pathindex.ctp
File metadata and controls
28 lines (27 loc) · 1007 Bytes
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
<?php
/**
* Copyright 2010 - 2011, Cake Development Corporation (http://cakedc.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2010 - 2011, Cake Development Corporation (http://cakedc.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!empty($user_details)) {
echo $this->Form->create('UserDetail');
foreach ($user_details as $user_detail) {
$options = array();
$options['type'] = $user_detail['UserDetail']['input'];
if ($user_detail['UserDetail']['input'] == 'checkbox') {
if ($user_detail['UserDetail']['value'] == 1) {
$options['checked'] = true;
}
}
if ($user_detail['UserDetail']['input'] == 'text' || $user_detail['UserDetail']['input'] == 'textarea' ) {
$options['value'] = $user_detail['UserDetail']['value'];
}
echo $this->Form->input($user_detail['UserDetail']['field'], ($options));
}
echo $this->Form->end(__d('users', 'Submit'));
}