Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}, 'empty' => true]);
{{- "\n" }}
{%- else %}
echo $this->Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}]);
{{- "\n" }}
{%- endif %}
{%- elseif field not in ['created', 'modified', 'updated'] %}
{%- set fieldData = Bake.columnData(field, schema) %}
{%- if fieldData.type in ['date', 'datetime', 'time'] and fieldData.null %}
echo $this->Form->control('{{ field }}', ['empty' => true]);
{{- "\n" }}
{%- else %}
echo $this->Form->control('{{ field }}');
{{- "\n" }}
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if associations.BelongsToMany %}
{%- for assocName, assocData in associations.BelongsToMany %}
echo $this->Form->control('{{ assocData.property }}._ids', ['options' => ${{ assocData.variable }}]);
{{- "\n" }}
{%- endfor %}
{% endif %}
?>
Form->submit(__('Submit')); ?>
Form->end(); ?>