mootensai / yii2-enhanced-gii

Enhanced Yii2 Gii (generator) that generates related Models & CRUD
MIT License
203 stars 98 forks source link

Controller generated with error #112

Closed rmaranhao closed 7 years ago

rmaranhao commented 7 years ago

Hi. First, congrats! This seems to be an awesome extension, much like GiiX for Yii1.

I have a problem though. I have an existing database in MySQL. I've created all models and now I am trying to create the CRUDS.

No matter what options I select I always get this code in the CONTROLLER: public function actionView($) { $model = $this->findModel($); return $this->render('view', [ 'model' => $this->findModel($), ]); }

I am using MariaDB 10.1.21 and PHP 5.6.30, with Yii 2.0.12

Can anyone help?

rmaranhao commented 7 years ago

Found it!.

Somehow my tables have the ID column, but they are not PK.

Then where the generator should write $id it only writes $.

My fault entirely.