ultilize composer para instalar esta extensão.
execute
$ composer require dynamikaweb/yii2-1doc-api
ou adicione
"dynamikaweb/yii2-1doc-api" : "*"
to the require section of your application's composer.json
file.
adicione ao arquivo config/main.php
o seguinte component:
'components' => [
'OneDocApi' => [
'class' => 'dynamikaweb\api\OneDocApi',
'client_auth' => '',
'token' => '',
'secret' => '',
],
],
class DemoController extends MyBaseController
{
public function actionIndex()
{
$api = Yii::$app->OneDocApi;
$api->find([
'method' => 'list',
'documento' => 24,
'grupo' => 19
]);
return $this->render('index', ['api' => $api->run]);
}
}