rezzza/shorty-bundle
最新稳定版本:v1.2.1
Composer 安装命令:
composer require rezzza/shorty-bundle
包简介
Underwear for your long urls in Symfony
README 文档
README
Underwear for your long urls in Symfony.
Integration of Shorty library.
Installation
Use Composer to install: rezzza/shorty-bundle.
In your composer.json you should have:
{ "require": { "rezzza/shorty-bundle": "2.0.*" } }
Then update your AppKernel.php to register the bundle with:
new Rezzza\ShortyBundle\RezzzaShortyBundle()
Configuration
rezzza_shorty: default_provider: google providers: google: id: google key: ~ http_adapter: ~ # default is Rezzza\Shorty\Http\CurlAdapter google2: id: google key: anotherkey bitly: id: bitly access_token: ~ #required http_adapter: ~ # default is Rezzza\Shorty\Http\CurlAdapter custom: id: my_custom_service chain: id: chain providers: [google, bitly, custom, google2]
Basic usage
$shorty = $this->container->get('rezzza.shorty.google'); // or $shorty = $this->container->get('rezzza.shorty'); // will use default_provider. try { $short = $shorty->shorten('http://www.verylastroom.net'); $long = $shorty->expand($long); } catch (\Rezzza\Shorty\Exception\Exception $e) { // oops ... }
Exceptions
Exceptions directory.
统计信息
- 总下载量: 13.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-06-24