deesoft / yii2-rest
Yii2 rest extension
Installs: 13 207
Dependents: 3
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- deesoft/yii2-base: ~1.0
- yiisoft/yii2: >=2.0.4
This package is not auto-updated.
Last update: 2024-12-21 19:16:02 UTC
README
Yii2 rest extension
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require deesoft/yii2-rest "~1.0"
or add
"deesoft/yii2-rest": "~1.0"
to the require section of your composer.json
file.
Usage
In controller
public function actions() { return [ 'index' => [ 'class' => 'dee\rest\RestAction', ], ]; }
To use url rule. Set in config
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ [ 'class' => 'dee\rest\UrlRule', 'actions' => [ 'post' => 'post/index', ], ], ], ],