chg: [genericElement:fieldScaffold] Let cake's form helper decide the input type if not specified
parent
b121399304
commit
21c5601c29
|
@ -1,12 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
if (is_array($fieldData)) {
|
if (is_array($fieldData)) {
|
||||||
if (empty($fieldData['type'])) {
|
|
||||||
$fieldData['type'] = 'text';
|
|
||||||
}
|
|
||||||
$fieldTemplate = 'genericField';
|
$fieldTemplate = 'genericField';
|
||||||
|
if (!empty($fieldData['type'])) {
|
||||||
if (file_exists(ROOT . '/templates/element/genericElements/Form/Fields/' . $fieldData['type'] . 'Field.php')) {
|
if (file_exists(ROOT . '/templates/element/genericElements/Form/Fields/' . $fieldData['type'] . 'Field.php')) {
|
||||||
$fieldTemplate = $fieldData['type'] . 'Field';
|
$fieldTemplate = $fieldData['type'] . 'Field';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (empty($fieldData['label'])) {
|
if (empty($fieldData['label'])) {
|
||||||
if (!isset($fieldData['label']) || $fieldData['label'] !== false) {
|
if (!isset($fieldData['label']) || $fieldData['label'] !== false) {
|
||||||
$fieldData['label'] = \Cake\Utility\Inflector::humanize($fieldData['field']);
|
$fieldData['label'] = \Cake\Utility\Inflector::humanize($fieldData['field']);
|
||||||
|
|
Loading…
Reference in New Issue