-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to set default settings in app config #4
Comments
you probably know you can just use the widget as:
to add the blank image provided by gravatar... or replace value with 'monster' or your own url |
Even two places are enough to want a common place for config, aren't they? :) |
True. |
Well I hope that maybe @cebe would be willing to implement this. If not, I'll consider forking, but more likely I'll just use the widget as it is now and specify that configuration separately for each instance. |
OK, I found a way to achieve this: I added the following to the array returned by 'gravatar' => [
'defaultImage' => 'retro',
'rating' => 'g',
], And then I can use these settings when placing the gravatar widget like this: <?= Gravatar::widget([
'email' => $model->email,
'size' => 100,
'defaultImage' => Yii::$app->params['gravatar']['defaultImage'],
'rating' => Yii::$app->params['gravatar']['rating'],
'options' => [
'alt' => Yii::t('app', 'author'),
'class' => 'img-responsive'
],
]) ?> |
related to yiisoft/yii2-bootstrap#89, you may check the DI solution linked there. |
It would be nice if I could set default options for this widget somewhere in the application config file. Things like
$defaultImage
,$rating
or$fileType
aren't likely to vary between places within a single webapp.The text was updated successfully, but these errors were encountered: