I need to show unread messages in menu in main layout menu. When im using model in main.php layout (for example use yii\models\User; and in body <?php User::find(1); ?>) i found that page will be reloaded twice (first: then i open url forexample www.x.com/user/dashboard second: just reloaded ) . If i remove User::find(1); then page will be rendered only once! Same thing then i use widget and call User::find(1); inside widget. But page will continuesly reloaded twice.
Can anybody help ?