Skip to content

Commit

Permalink
Refs #147. Adding more verbose baked validations for models.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Jan 1, 2010
1 parent 32683d3 commit 47fc47f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cake/console/templates/default/classes/model.ctp
Expand Up @@ -42,7 +42,14 @@ if (!empty($validate)):
foreach ($validate as $field => $validations):
echo "\t\t'$field' => array(\n";
foreach ($validations as $key => $validator):
echo "\t\t\t'$key' => array('rule' => array('$validator')),\n";
echo "\t\t\t'$key' => array(\n";
echo "\t\t\t\t'rule' => array('$validator'),\n";
echo "\t\t\t\t//'message' => 'Your custom message here',\n";
echo "\t\t\t\t//'allowEmpty' => false,\n";
echo "\t\t\t\t//'required' => false,\n";
echo "\t\t\t\t//'last' => false, // Stop validation after this rule\n";
echo "\t\t\t\t//'on' => 'create', // Limit validation to 'create' or 'update' operations\n";
echo "\t\t\t),\n";
endforeach;
echo "\t\t),\n";
endforeach;
Expand Down

0 comments on commit 47fc47f

Please sign in to comment.