Switching on the category type to determine which type of input to display.
This commit is contained in:
parent
6faa248248
commit
567c0c5c20
|
@ -19,10 +19,23 @@ foreach ($options as $option => $value) {
|
|||
foreach ($value as $val) {
|
||||
$id = $val['Config']['Id'];
|
||||
$inputname = 'Config.' . $id . '.' . $val['Config']['Name'];
|
||||
|
||||
switch ($val['Config']['Type']) {
|
||||
case 'boolean':
|
||||
$type = 'checkbox';
|
||||
break;
|
||||
case 'integer':
|
||||
$type = 'text';
|
||||
break;
|
||||
case 'string':
|
||||
$type = 'text';
|
||||
break;
|
||||
}
|
||||
echo $this->Form->input($inputname, array(
|
||||
'default' => $val['Config']['Value'],
|
||||
'label' => $val['Config']['Name'],
|
||||
'title' => $val['Config']['Prompt']
|
||||
'title' => $val['Config']['Prompt'],
|
||||
'type' => $type
|
||||
));
|
||||
echo "\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue