https://github.com/xutl/yii2-dingtalk
适用于Yii2 的钉钉聊天机器人
https://github.com/xutl/yii2-dingtalk
dingtalk yii2 yii2-extension
Last synced: 8 days ago
JSON representation
适用于Yii2 的钉钉聊天机器人
- Host: GitHub
- URL: https://github.com/xutl/yii2-dingtalk
- Owner: xutl
- License: mit
- Created: 2017-08-04T03:58:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T09:31:27.000Z (over 7 years ago)
- Last Synced: 2025-04-03T04:33:10.252Z (about 2 months ago)
- Topics: dingtalk, yii2, yii2-extension
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yii2-dingtalk
[](https://packagist.org/packages/xutl/yii2-dingtalk)
[](https://packagist.org/packages/xutl/yii2-dingtalk)
[](https://www.versioneye.com/php/xutl:yii2-dingtalk/dev-master)
[](https://packagist.org/packages/xutl/yii2-dingtalk)Installation
------------Next steps will guide you through the process of installing using [composer](http://getcomposer.org/download/). Installation is a quick and easy three-step process.
### Step 1: Install component via composer
Either run
```
composer require --prefer-dist xutl/yii2-dingtalk
```or add
```json
"xutl/yii2-dingtalk": "~1.0.0"
```to the `require` section of your composer.json.
### Step 2: Configuring your application
Add following lines to your main configuration file:
```php
'components' => [
'log' => [
'targets' => [
[
'class' => 'xutl\dingtalk\DingTalkTarget',
'dingTalk' => 'dingTalk',
'levels' => ['error', 'warning'],
],
],
],
'dingTalk' => [
'class' => 'xutl\dingtalk\DingTalk',
'accessToken' => '1234567890',
],
],
```### Step 3: Start using
```php
Yii::$app->dingTalk->sendText('我其实是一个机器人');
Yii::$app->dingTalk->sendLink('我其实是一个机器人','我其实是一个机器人我其实是一个机器人我其实是一个机器人我其实是一个机器人!','','https://www.dingtalk.com/');
Yii::$app->dingTalk->sendMarkdown('我其实是一个机器人','我其实是一个机器人');
Yii::$app->dingTalk->sendActionCard......
```Read [https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.p2lr6t&treeId=257&articleId=105733&docType=1](https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.p2lr6t&treeId=257&articleId=105733&docType=1) to continue
## License
This is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)
for details.