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 3c2ab3b commit 711f0ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example-views/phundament/app/layouts/_sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<div class="pull-left image">
<?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 Expand Up @@ -91,4 +93,4 @@
'options' => ['class' => 'sidebar-menu'],
'items' => \yii\helpers\ArrayHelper::merge($favouriteMenuItems, $menuItems),
]);
?>
?>

0 comments on commit 711f0ae

Please sign in to comment.