Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the template for Gii CRUD generator more readable #163

Open
n3yang opened this issue Apr 11, 2018 · 1 comment
Open

Making the template for Gii CRUD generator more readable #163

n3yang opened this issue Apr 11, 2018 · 1 comment

Comments

@n3yang
Copy link

n3yang commented Apr 11, 2018

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
Copy link
Member

Not really, but PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants