yii2-google-url-shortener

[size="5"]yii2-google-url-shortener[/size]

Download: github.com/Sect0R/yii2-google-url-shortener

Simple Yii2 component to short URL or expand URL using google API Url Shortener.

[size="3"]Installation[/size]

  • create folder components in your yii2

  • move GoogleShortUrl.php into components folder

  • add component class to config/main.php configuration file




....

'components' => [

        'google' => [

            'class' => 'app\components\GoogleShortUrl'

        ],

        .......

];

....



[size="3"]Usage[/size]

Short Url:




return Yii::$app->google->shortUrl('google.com');



Expand shorten Url:




return Yii::$app->google->expandUrl('goo.gl/FuAUYl');