2017 © Pedro Peláez
 

yii2-extension tw-yii2-rest

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

image

taktwerk/tw-yii2-rest

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  • Monday, February 22, 2016
  • by ilestis
  • Repository
  • 1 Watchers
  • 0 Stars
  • 750 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 4 % Grown

The README.md

TW-Yii2-Rest

Forked and modified from HarryZheng0907's yii-rest., (*1)

This package adds some practical search options for your Yii2 ActiveControler's index action., (*2)

Functionality

  1. Search capability
http://url/users?id=1&username=LIKE_dmi&created_at=MAX_1398153715&addresses.city=南京
  1. Multi-level expanding of relations
http://url/users?expand=addresses,friends.addresses&expand-fields=addresses.phone,friends.addresses
  1. Sorting by child relation
http://url/users?sort=addresses.phone DESC,id ASC
  1. Grouping
http://url/rooms?group=building.building_id=4

Installation

php composer.phar require taktwerk/tw-yii2-rest

Usage

IndexAction

Change the IndexAction of your Active Controlers to point to taktwerk\rest\IndexAction, (*3)

Examples

EQUAL:http://url/users?username=EQUAL_a  // username = 'a'
NOTEQUAL:http://url/users?username=NOTEQUAL_a  // username != 'a'
NULL:http://url/users?username=NULL_  // username IS NULL
LIKE:http://url/users?username=LIKE_a  //username LIKE '%a%'
LLIKE:http://url/users?username=LLIKE_a  //username LIKE '%a'
RLIKE:http://url/users?username=RLIKE_a  //username LIKE 'a%'
IN:http://url/users?username=IN_a,b,c  //username IN ('a','b','c')
NOTIN:http://url/users?username=NOTIN_a,b,c  //username NOT IN ('a','b','c')
MIN:http://url/users?age_min=MIN_10  // age >= 10
MAX:http://url/users?age_max=Max_60  //age <= 60
RANGE:http://url/users?birthdate=RANGE_2015-03  //birthdate<=2015-03-31 AND birthdate >= 2015-03-01

The Versions

22/02 2016

dev-develop

dev-develop

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  Sources   Download

BSD

The Requires

 

by Taktwerk

api rest yii2 restful

22/02 2016

v1.0.2

1.0.2.0

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  Sources   Download

BSD

The Requires

 

by Taktwerk

api rest yii2 restful

12/02 2016

dev-master

9999999-dev

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  Sources   Download

BSD

The Requires

 

by Taktwerk

api rest yii2 restful

12/02 2016

v1.0.1

1.0.1.0

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  Sources   Download

BSD

The Requires

 

by Taktwerk

api rest yii2 restful

12/02 2016

v1.0.0

1.0.0.0

The enhanced restful api for Yii Framework 2.0 based on HarryZheng0907's yii2-rest

  Sources   Download

BSD

The Requires

 

by Taktwerk

api rest yii2 restful