model generator

Suggest to provide a key in the model code geneator UI to use the

column name or Foreign key table name and use the key in giixmodelcode.php line 146.

I commented the lines as below because giix produces same label for different objects as they are tied to the same foreign table.

foreach ($table->columns as $column) {

// if ($column->isForeignKey) {

// $label = null;

// } else {

			$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);


			if ($label === 'Id')


				$label = 'ID';





			$label = "Yii::t('app', '{$label}')";

// }

Dear globalkrishna,

Welcome to the forum!

giix is an extension to Yii. It is not part of the core.

If you want to submit feature requests, please post them at in giix’s issue tracker.

Thank you!