dmstr / yii2-adminlte-asset

AdminLTE Asset Bundle for Backend Theme in Yii2 Framework
1.14k stars 424 forks source link

Making the template for Gii CRUD generator more readable #163

Open n3yang opened 6 years ago

n3yang commented 6 years ago

The template is great, but not more readable than official.

For example: yii2-adminlte-asset template: controller.php

    public function actionCreate()
    {
        $model = new <?= $modelClass ?>();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', <?= $urlParams ?>]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

Official template(version 2.0.15): controller.php

    public function actionCreate()
    {
        $model = new <?= $modelClass ?>();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', <?= $urlParams ?>]);
        }

        return $this->render('create', [
            'model' => $model,
        ]);
    }

Would you have any plan to update it ? Thanks.

schmunk42 commented 6 years ago

Not really, but PRs are welcome.