@@ -3,7 +3,7 @@ This is the core of [LasseRafn/php-initial-avatar-generator](http://github.com/L
33
44It's framework agnostic, which is different from basically everything else I do, you're welcome.
55
6- Supports UTF8 (yes.. also emojis.)
6+ Supports UTF8 (yes, also emojis.)
77
88<p align =" center " >
99<a href =" https://travis-ci.org/LasseRafn/php-initials " ><img src =" https://img.shields.io/travis/LasseRafn/php-initials.svg?style=flat-square " alt =" Build Status " ></a >
@@ -16,32 +16,35 @@ Supports UTF8 (yes.. also emojis.)
1616
1717## Installation
1818You just require using composer and you're good to go!
19- ```` bash
19+ ``` bash
2020composer require lasserafn/php-initials
21- ````
21+ ```
22+
2223Rad, * and long* , package name.. huh? Sorry. I'm not very good with names.
2324
2425## Usage
2526As with installation, usage is quite simple. Generating a image is done by running:
26- ```` php
27- echo (string) (new LasseRafn\Initials\Initials('Lasse Rafn')); // Output: LR
28- echo (new LasseRafn\Initials\Initials)->name('Justine Bieber')->generate(); // Output: JB
29- echo (new LasseRafn\Initials\Initials('John Christian Doe'))->generate(); // Output: JD
30- echo (new LasseRafn\Initials\Initials)->generate('Leonardo'); // Output: LE
31- echo (new LasseRafn\Initials\Initials)->length(1)->generate('Camilla'); // Output: C
32- echo (new LasseRafn\Initials\Initials)->length(3)->name('Jens Ølsted')->getUrlfriendlyInitials(); // Output: JOL
33- ````
27+ ``` php
28+ use LasseRafn\Initials\Initials;
29+
30+ echo (new Initials('Lasse Rafn')); // Output: LR
31+ echo (new Initials)->name('Justine Bieber')->generate(); // Output: JB
32+ echo (new Initials('John Christian Doe'))->generate(); // Output: JD
33+ echo (new Initials)->generate('Leonardo'); // Output: LE
34+ echo (new Initials)->length(1)->generate('Camilla'); // Output: C
35+ echo (new Initials)->name('Jens Ølsted')->getUrlfriendlyInitials(); // Output: JO
36+ ```
3437
3538## Supported methods and parameters
3639### Name (initials) - default: JD
37- ```` php
40+ ``` php
3841$initials->name('Albert Magnum')->generate();
39- ````
42+ ```
4043
4144### Length - default: 2
42- ```` php
45+ ``` php
4346$initials->name('Albert Magnum')->length(3)->generate();
44- ````
47+ ```
4548
4649## Requirements
4750* PHP 5.6, 7.0 or 7.1
0 commit comments