承接 ph-7/ph2gravatar 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ph-7/ph2gravatar

最新稳定版本:v2.0.1

Composer 安装命令:

composer require ph-7/ph2gravatar

包简介

🎉 An easy and elegant way to generate gravatars 🖼

README 文档

README

🖼 The simplest Gravatar PHP package

Easy as it's supposed to be 💪

Ko Fi - Offer Me A Coffee

pH2Gravatar is lightweight gravatar library giving you an elegant way to generate gravatar profile photos from email addresses 🪄

⛏ Requirements

🏗 How to install it?

With composer:

composer require ph-7/ph2gravatar

💭 How to use it?

Example 1

require __DIR__ . '/vendor/autoload.php';

use PH7\PH2Gravatar\Image;
?>

<!-- Here, we leave the default parameters. https://en.gravatar.com/site/implement/images/ -->
<!-- By default, the image size is 200px -->
<img src="<?= Image::get('me@test.email') ?>" alt="My gravatar image" />


<!-- Here, we set the gravatar image size to 400px -->
<img src="<?= Image::get('me@test.email', ['size' => 400]) ?>" alt="My gravatar image" />

Example 2

require __DIR__ . '/vendor/autoload.php';

use PH7\PH2Gravatar\Image as Gravatar;

// Show the gravatar image link
echo Gravatar::get('me@test.email', [
    'size' => 80,
    'rating' => 'pg',
    'display' => 'retro'
]);
// https://www.gravatar.com/avatar/9c47a7bb2aec6e61df372a8f8446ed9d?s=80&r=pg&d=retro

Example 3

require __DIR__ . '/vendor/autoload.php';

use PH7\PH2Gravatar\Image as GravatarImage;

$email = 'me@myemail.com';
$size = 400;

$imageUrl = GravatarImage::get($email, [
    'size' => $size,
    'display' => '404',
    'rating' => 'g'
    ]
);

// $imageUrl output
// https://www.gravatar.com/avatar/4995f3f0b59f4abfda86e74f92896f3b?s=400&r=g&d=404

🪄 Author

I'm Pierre-Henry Soria. A dedicated, passionate and positive software engineer 😊 You can keep in touch with me at hi [[AT]] ph7 {{D0T}} me 📮

@phenrysay pH-7

Are you enjoying my work? Offer me a coffee and boost the software development at the same time! 💪

Pierre-Henry Soria

📺 Watch me building it!

Watch the video

👉 Click here to watch on YouTube

📃 License

pH2Gravatar is distributed under MIT license 🚀 Enjoy!

统计信息

  • 总下载量: 4.73k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-24