Warning, /webapps/ocs-webserver/library/vendor/yohang88/letter-avatar/README.md is written in an unsupported language. File is not indexed.
0001 # Letter Avatar for PHP 0002 0003 Generate user avatar using name initials letter. 0004 0005 ![letter-avatar](https://cloud.githubusercontent.com/assets/618412/12192012/835c7488-b60d-11e5-9276-d06f42d11a86.png) 0006 0007 ## Features 0008 * Data URI image ready (also save as PNG/JPG). 0009 * Consistent color. 0010 * Customize size, shape: square, circle. 0011 * Small, fast. 0012 0013 ## Install 0014 0015 Via Composer 0016 0017 ``` bash 0018 $ composer require yohang88/letter-avatar 0019 ``` 0020 0021 ### Implementation 0022 0023 ``` php 0024 <?php 0025 0026 use YoHang88\LetterAvatar\LetterAvatar; 0027 0028 $avatar = new LetterAvatar('Steven Spielberg'); 0029 0030 // Square Shape, Size 64px 0031 $avatar = new LetterAvatar('Steven Spielberg', 'square', 64); 0032 0033 // Save Image As PNG/JPEG 0034 $avatar->saveAs('path/to/filename'); 0035 $avatar->saveAs('path/to/filename', LetterAvatar::MIME_TYPE_JPEG); 0036 0037 ``` 0038 0039 ``` html 0040 <img src="<?php echo $avatar ?>" /> 0041 ```