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

Fix PR #383, fixing #328 again #387

Merged
merged 4 commits into from
Nov 23, 2018
Merged

Fix PR #383, fixing #328 again #387

merged 4 commits into from
Nov 23, 2018

Conversation

ricpelo
Copy link
Contributor

@ricpelo ricpelo commented Nov 22, 2018

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues #388

PR #383 re-introduces the issue #328 which was fixed by #329 . This PR re-fixed it again, so it fixes #388.

@ricpelo
Copy link
Contributor Author

ricpelo commented Nov 23, 2018

This is an example of how the generated code looks using this PR, with & without 'name' attribute, and with & without i18n enabled:

With 'name' attribute, no i18n:

$this->title = 'Update Generos: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';

With 'name' attribute and i18n:

$this->title = Yii::t('app', 'Update Generos: {name}', [
    'name' => $model->name,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');

Without 'name' attribute, no i18n:

$this->title = 'Update Generos: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Generos', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';

Without 'name' attribute, with i18n:

$this->title = Yii::t('app', 'Update Generos: {name}', [
    'name' => $model->id,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Generos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');

The generated code is always correct, on every case.

@samdark samdark merged commit 89c3865 into yiisoft:master Nov 23, 2018
@samdark
Copy link
Member

samdark commented Nov 23, 2018

Merged. Thanks!

@samdark samdark added this to the 2.0.8 milestone Nov 23, 2018
@ricpelo
Copy link
Contributor Author

ricpelo commented Nov 23, 2018

Thanks to you!

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

Successfully merging this pull request may close these issues.

PR #383 re-introduces the issue #328
2 participants