PHP code example of xutl / yii2-dingtalk

1. Go to this page and download the library: Download xutl/yii2-dingtalk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xutl / yii2-dingtalk example snippets


    'components' => [
        'log' => [
            'targets' => [
                [
                    'class' => 'xutl\dingtalk\DingTalkTarget',
                    'dingTalk' => 'dingTalk',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'dingTalk' => [
            'class' => 'xutl\dingtalk\DingTalk',
            'accessToken' => '1234567890',
        ],
    ],

Yii::$app->dingTalk->sendText('我其实是一个机器人');
Yii::$app->dingTalk->sendLink('我其实是一个机器人','我其实是一个机器人我其实是一个机器人我其实是一个机器人我其实是一个机器人!','','https://www.dingtalk.com/');
Yii::$app->dingTalk->sendMarkdown('我其实是一个机器人','我其实是一个机器人');
Yii::$app->dingTalk->sendActionCard......