Switching on the category type to determine which type of input to display.

This commit is contained in:
Kyle Johnson 2013-06-21 22:20:16 -04:00
parent 6faa248248
commit 567c0c5c20
1 changed files with 14 additions and 1 deletions

View File

@ -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";
}