Skip to content

Commit 45cffbf

Browse files
author
Christopher Stebe
committed
updated Gravatar widget E-Mail usage
by default in combination with `dektrium/yii2-user` the `profile->gravatar_email` is `NULL` by default. So now it is ensured that a E-Mail will be set even if the `profile->gravatar_email` is not given.
1 parent 711f0ae commit 45cffbf

File tree

1 file changed

+3
-1
lines changed
  • example-views/phundament/app/layouts

1 file changed

+3
-1
lines changed

example-views/phundament/app/layouts/main.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@
9797
<li class="user-header bg-light-blue">
9898
<?php echo \cebe\gravatar\Gravatar::widget(
9999
[
100-
'email' => \Yii::$app->user->identity->email,
100+
'email' => (\Yii::$app->user->identity->profile->gravatar_email === null)
101+
? \Yii::$app->user->identity->email
102+
: \Yii::$app->user->identity->profile->gravatar_email,
101103
'options' => [
102104
'alt' => \Yii::$app->user->identity->username
103105
],

0 commit comments

Comments
 (0)