Skip to content

rob-mccann/fuel-urlshortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fuel Url Shortener Package.

A driver-based url shortener package for FuelPHP

Summary

  • Driver-based shortening and expanding of urls (poss. more features to follow)
  • Includes bit.ly driver. If you create more, pull request and I'll include them :)

Usage

Make sure you copy the config file from fuel/packages/fuel-urlshortener/config/urlshortener.php into fuel/app/config/urlshortener.php before you implement this

//create the shortener
$shortener = \Urlshortener\Urlshortener::forge(array('driver'=>'bitly'));

//shorten a url
$short_url = $shortener->shorten('http://robmccann.co.uk');

//expand a shortened url to get its long url
$expanded_url = $shortener->expand('http://robm.cc/lyiAk0');

Exceptions

+ NotFoundException, thrown when expanding a short url and the short url doesn't exist
+ Fuel_Exception, thrown there is a problem with the config or api, see getMessage() for more info

About

A FuelPHP package that adds driver support for URL shorteners

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages