https://github.com/undefinedor/smartrest
A smart rest function for yii2
https://github.com/undefinedor/smartrest
yii2 yii2-extension
Last synced: 8 months ago
JSON representation
A smart rest function for yii2
- Host: GitHub
- URL: https://github.com/undefinedor/smartrest
- Owner: undefinedor
- License: mit
- Created: 2019-07-01T07:20:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-01T08:28:01.000Z (about 7 years ago)
- Last Synced: 2025-01-31T20:55:51.450Z (over 1 year ago)
- Topics: yii2, yii2-extension
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-ZH.md
- License: LICENSE
Awesome Lists containing this project
README
# SmartRest
## 目的
官方提供的`yii\rest\urlRule`类必须声明controller属性。每次增加控制器的时候,都需要在`controller`属性中声明,过于繁琐。本项目解决了该问题。
## 安装
最佳方式是通过[Composer](https://getcomposer.org/download/) .
```
composer require undefinedor/smart-rest
```
## 使用方法
```php
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => true,
'rules' => [
['class' => 'SmartRest\UrlRule'],
],
],
```