dev-master
9999999-devGet a slug from a URL
MIT
The Development Requires
by Eirik S. Morland
1.0.0
1.0.0.0Get a slug from a URL
MIT
The Development Requires
by Eirik S. Morland
Wallogit.com
2017 © Pedro Peláez
Get a slug from a URL
Get a slug from a URL, (*1)
composer require violinist-dev/slug-from-url
<?php
use Violinist\Slug\Slug;
// Probably uou want to use this directly from a URL somehow. Like so:
$slug = Slug::createFromUrl('https://github.com/violinist-dev/slug-from-url');
// Maybe you want the github slug:
$gh_slug = $slug->getSlug(); // Returns violinist-dev/slug-from-url
// Or maybe you want to get the username:
$username = $slug->getUserName(); // Returns violinist-dev
// ...or here is the repo name.
$repo = $slug->getUserRepo(); // Returns slug-from-url
MIT, (*3)
Get a slug from a URL
MIT
Get a slug from a URL
MIT