alexeevdv / yii2-gravatar-widget
Yii2 的 Gravatar 小部件
1.0.0
2019-03-15 23:18 UTC
Requires
- yiisoft/yii2: ^2.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-16 18:30:19 UTC
README
Yii2 的 Gravatar 服务封装。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
$ php composer.phar require alexeevdv/yii2-gravatar-widget
或者
"alexeevdv/yii2-gravatar-widget": "^1.0"
将以下内容添加到您的 composer.json
文件的 require
部分:
使用方法
echo \alexeevdv\yii\gravatar\Widget([ "email" => "mail@example.com", // required ]);
参数
/** * User email address */ string $email; /** * Use HTTPS connection? */ bool $secure = true; /** * Append .jpg extension? */ bool $extension = true; /** * Avatar width and height. Must be beetween 1 and 2048 */ integer $size; /** * Default image if avatar is not available. Must be valid image URI or one of the following strings: * "404", "mm", "identicon", "monsterid", "wavatar", "retro", "blank" */ string $defaultImage; /** * Force default image even if the avatar is available? */ bool $forceDefault = false; /** * Allowed avatar rating. Must be one of the following strings: * "g", "pg", "r", "x" */ string $rating; /** * Additional HTML attributes to img tag */ array $options = [];
更多信息请参阅 Gravatar 手册。