atans/yii2-weibo-shorturl

微博短链接客户端

安装: 13

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:yii2-extension

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

This package is auto-updated.

Last update: 2024-09-13 23:44:17 UTC


README

微博短链接客户端

安装

安装此扩展的首选方式是通过 composer

运行

composer require atans/yii2-weibo-shorturl

或添加

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

到你的 composer.json 文件的 require 部分中。

用法

// 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('https://yiiframework.cn');