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

render требует необязательные переменные #234

Open
siggi-k opened this issue Oct 24, 2019 · 1 comment
Open

Comments

@siggi-k
Copy link

siggi-k commented Oct 24, 2019

What steps will reproduce the problem?

View:

<?= $this->render('/transaction-actual/buttons/_edit',    ['bud_id' => $model->id]); ?>

/buttons/_edit:

  1. Вариант
$bud_id  = $bud_id ?? null;

echo Html::a(   'edit',
    [
        'create',
        'bud_id' => $bud_id,
    ]
);

Error

Bildschirmfoto von »2019-10-24 10-12-39«

Во View , Render не видит что 'bud_id' используется.
'bud_id' = серого цвета

/buttons/_edit:
2) Вариант

echo Html::a(   'edit',
    [
        'create',
        'bud_id' => $bud_id ?? null,
    ]
);

Error

Bildschirmfoto von »2019-10-24 10-10-13«
Во View , Render не видит что 'bud_id' не обязательно должно быть передано.
Если значение отсутствует, передается null.
Во View весь Render = подчеркнут красным цветом.

Additional info

PhpStorm
Yii 2

@xstreamka
Copy link

Подтверждаю!

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

No branches or pull requests

2 participants