setFlash display alert

Hi, i has multiple yii2 project. I notice that when i use code

Yii::$app->session->setFlash('error', Yii::t('app', 'some error'));

Yii will automatically display danger alert for that flash data.
But one project that orginally yii2 version 2.0.6, upgraded to 2.0.12 did not display the alert automatically. After upgrade to version 2.0.17 still same.

This is not much of a problem, but would be nice to know the reason.

I guess it may be the application template. We’ve added Alert widget from advanced template to basic template layout between one of those versions.

do you mean the file app\views\layout\main.php?

Yes. Layout.

Got it, thanks.

So i need to copy the widgets folder below the web folder. Why this not added with update? Just curious.

It is added. For new applications you’ll get it but the application template is a template i.e. you’re taking it once and it’s yours afterwards.