jamosaur / avtr-io
avtr.io API包装器
v1.0.0
2017-03-31 14:36 UTC
Requires
- php: ~7.0
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-09-09 21:29:38 UTC
README
avtr.io API包装器
安装
通过Composer
$ composer require jamosaur/avtr-io
用法
require Jamosaur\Avtr; $avtr = new Avtr('James Wallen-Jones'); echo '<img src="' . $avtr->toUrl() . '">';
可用选项
// Construct with email. $avtr = new Avtr('j.wallen.jones@googlemail.com'); // Construct with name. $avtr = new Avtr('James Wallen-Jones'); // Construct with initials. $avtr = new Avtr('JW'); // Image Format. (png, jpg, gif) $avtr->format(string); // Setting a first name. $avtr->firstName(string); // Setting a last name. $avtr->lastName(string); // Setting the letter count. (1, 2) // Anything below 1 will default to 1. // Anything above 2 will default to 2. $avtr->letterCount(int); // Setting the background colour. // Values below 0 will default to 0. // Values above 255 will default to 255. // Alpha value is 0.0 - 1.0 $avtr->background(r, g, b, a); // Setting the image size. // Values below 0 will default to 100 $avtr->size(500); // Setting rounded corners. $avtr->roundedCorners(bool); // Setting Shape. (square, circle) $avtr->shape(string); // Setting theme. (material, flat) $avtr->theme(string); // Setting text Case. (lower, upper, title) $avtr->textCase(string); // Setting text colour. // Values below 0 will default to 0. // Values above 255 will default to 255. // Alpha value is 0.0 - 1.0 $avtr->color(r, g, b, a); // Setting font weight. (100-900) // Values below 100 default to 100 // Values above 900 default to 900 $avtr->fontWeight(100); // Setting font. (open-sans, source-sans-pro, roboto) $avtr->font(string); // Return a URL $avtr->toUrl();
变更日志
请参阅变更日志以获取最近更改的更多信息。
测试
$ composer test
贡献
安全性
如果您发现任何与安全性相关的问题,请通过j.wallen.jones@googlemail.com发送电子邮件,而不是使用问题跟踪器。
致谢
许可协议
MIT许可(MIT)。请参阅许可文件以获取更多信息。