Updating default bake templates to exclude primary key input for all actions containing 'add'

Fixes #319
This commit is contained in:
mark_story 2009-11-21 21:10:31 -05:00
parent d1066bfeaf
commit f038cb8ffb

View file

@ -24,7 +24,7 @@
<?php <?php
echo "\t<?php\n"; echo "\t<?php\n";
foreach ($fields as $field) { foreach ($fields as $field) {
if ($action == 'add' && $field == $primaryKey) { if (substr($action, 'add') !== false && $field == $primaryKey) {
continue; continue;
} elseif (!in_array($field, array('created', 'modified', 'updated'))) { } elseif (!in_array($field, array('created', 'modified', 'updated'))) {
echo "\t\techo \$this->Form->input('{$field}');\n"; echo "\t\techo \$this->Form->input('{$field}');\n";