Tools to use API as ActiveRecord for Yii2
Use your API as ActiveRecord
The preferred way to install this yii2-extension is through composer.
Either run
php composer.phar require "hiqdev/yii2-hiart"
or add
"hiqdev/yii2-hiart": "*"
to the require section of your composer.json.
To use this extension, configure hiart component in your application config:
'components' => [
'hiart' => [
'class' => 'hiqdev\hiart\Connection',
'config' => [
'api_url' => 'https://api.site.com/',
],
],
],
Define your Model
class MyModel extends \hiqdev\hiart\ActiveRecord
{
public function attributes()
{
return ['id', 'name', 'else'];
}
}
This project is released under the terms of the BSD-3-Clause license. Read more here.
Copyright © 2015-2016, HiQDev (http://hiqdev.com/)
- This project is based on Yii2 Elasticsearch.