Yii2 component for OK API

Installs: 41

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-components

1.0.1 2017-07-11 12:40 UTC

This package is auto-updated.

Last update: 2020-01-19 14:52:41 UTC


README

Russian

Install by composer

composer require oleg-chulakov-studio/yii2-okapi

Or add this code into require section of your composer.json and then call composer update in console

"oleg-chulakov-studio/yii2-okapi": "*"

Usage

In configuration file do

<?php
  'components'  =>  [
        'OkApi' => [
            'class' => \OlegChulakovStudio\okapi\YiiOkComponent::className(),
            'applicationId' => '',
            'applicationKey' => '',
            'applicationSecretKey' => '',
            'accessToken' => ''
        ],
  ]
 ?>

Use as simple component

<?php
$responseData = Yii::$app->YiiVk->request('search.tagContents', [
    'count' => 25,
    'query' => $this->tagSearch,
    'filter' => '{ "types" : ["USER_TOPIC", "USER_PHOTO","GROUP_PHOTO", "GROUP_TOPIC"]}',
    'fields' => 'group_photo.ID,group_photo.ALBUM_ID,group_photo.GROUP_ID,group_photo.PIC1024MAX',
]);
?>