Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 765 Bytes

README.Generate.md

File metadata and controls

19 lines (13 loc) · 765 Bytes

DrMVC\Helpers\Generate

Generators of slug from text or gravatar's url.

How to use

// Simple converter from any text to slug (with utf8 support)
$slug = Generate::slug('Ave Some'); // ave-some
$utf8 = Generate::slug('Коллекция мягких французских булок'); // коллекция-мягких-французских-булок

// Gravatar generator
$url = Generate::gravatar('[email protected]'); // https://www.gravatar.com/avatar/97dfebf4098c0f5c16bca61e2b76c373?s=80&d=mm&r=g
$img = Generate::gravatar('[email protected]', '80', 'mm', 'g', true); // <img src="https://www.gravatar.com/avatar/97dfebf4098c0f5c16bca61e2b76c373?s=80&d=mm&r=g" />

More examples

Some other examples of usage you can find here.