Yii Framework Forum: yii2-google-url-shortener - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

yii2-google-url-shortener Simple Yii2 component to short URL or expand URL using google API Url Rate Topic: -----

#1 User is offline   Sect0R 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 03-November 16

Posted 03 November 2016 - 02:14 PM

yii2-google-url-shortener

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

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

Installation

  • 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'
        ],
        .......
];
....


Usage

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


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

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users