atans/yii2-weibo-shorturl

Weibo short url client

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2017-01-01 13:40 UTC

This package is auto-updated.

Last update: 2024-04-13 22:53:16 UTC


README

Weibo short url client

Installation

The preferred way to install this extension is through composer.

Either run

composer require atans/yii2-weibo-shorturl

or add

"atans/yii2-weibo-shorturl": "*"

to the require section of your composer.json file.

Usage

// app/config/main-local.php

use atans\weibo\ShortUrl;

return [
    'components' => [
        // ...
        'shortUrl' => [
          'class' => ShortUrl::className(),
          'appKey' => '<your-app-key>',
        ],
    ],
];

// Use it

$response = Yii::$app->shortUrl->shorten('http://www.yiiframework.com');