Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonkodmitry/yii2-botan
Wrapper bot botan.io API
https://github.com/sonkodmitry/yii2-botan
Last synced: 20 days ago
JSON representation
Wrapper bot botan.io API
- Host: GitHub
- URL: https://github.com/sonkodmitry/yii2-botan
- Owner: SonkoDmitry
- License: other
- Created: 2015-08-09T14:12:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T09:14:56.000Z (over 9 years ago)
- Last Synced: 2024-12-18T08:13:23.091Z (20 days ago)
- Language: PHP
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Botan API for Yii2
================
This extension is the way to integrate [iprit/botan-php](https://packagist.org/packages/iprit/botan-php) wrapper with your Yii2 application.Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).To install, either run
```
$ composer require sonko-dmitry/yii2-botan:*
```
or add
```
"sonko-dmitry/yii2-botan": "*"
```
to the `require` section of your `composer.json` file.Usage
-----
0. Add the component configuration in your *global* `main.php` config file:
```php
'components' => [
'botan' => [
'class' => 'SonkoDmitry\Yii\Botan\Component',
'token' => 'YOUR_YANDEX_APPMETRIKA_TOKEN',
],
],
```0. Now you can use component
```php
public function _incomingMessage($message_json) {
$messageObj = json_decode($message_json, true);
$messageData = $messageObj['message'];
\Yii::$app->botan->track($messageData, 'Start');
}
```
Where 123 unique customer ID, for example chat_id or sender_id