Skip to content

Commit

Permalink
updated Gravatar widget E-Mail usage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Christopher Stebe committed Oct 7, 2015
1 parent 711f0ae commit 45cffbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example-views/phundament/app/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
<li class="user-header bg-light-blue">
<?php echo \cebe\gravatar\Gravatar::widget(
[
'email' => \Yii::$app->user->identity->email,
'email' => (\Yii::$app->user->identity->profile->gravatar_email === null)
? \Yii::$app->user->identity->email
: \Yii::$app->user->identity->profile->gravatar_email,
'options' => [
'alt' => \Yii::$app->user->identity->username
],
Expand Down

0 comments on commit 45cffbf

Please sign in to comment.