Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

label generation fix.

  • Loading branch information...
commit 97baae1e5ac10d10c41d654e5e03b4fa1b01cc6f 1 parent de4ee96
qiang.xue authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  framework/cli/commands/shell/ModelCommand.php
View
1  framework/cli/commands/shell/ModelCommand.php
@@ -378,6 +378,7 @@ public function generateModel($source,$params)
foreach($table->columns as $column)
{
$label=ucwords(trim(strtolower(str_replace(array('-','_'),' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $column->name)))));
+ $label=preg_replace('/\s+/',' ',$label);
if(strcasecmp(substr($label,-3),' id')===0)
$label=substr($label,0,-3);
$labels[]="'{$column->name}'=>'$label'";
Please sign in to comment.
Something went wrong with that request. Please try again.