2017 © Pedro Peláez
 

yii-extension yii-restful

Yii RESTful URL Manager

image

likai/yii-restful

Yii RESTful URL Manager

  • Sunday, March 30, 2014
  • by likai
  • Repository
  • 3 Watchers
  • 7 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yii RESTful URL Manager

Requirement

  • PHP >= 5.3.0

Installation

Add depend to your project composer.json file, (*1)

{
    "require": {
        "yii/yiisoft": "dev-master",
        "likai/yii-restful": "dev-master"
    }
}

After, run composer update update composer packages, (*2)

Usage

1. Add topics resource

return array(
    'urlManager'=>array(
        'class' => 'Likai\\YiiRestful\\UrlManager',
        'urlFormat' => 'path',
        'showScriptName' => false,
        'resources' => array(
            'topics',
        ),
    ),
);

UrlManager will generate 5 url rules and bind to the controller, like the following, (*3)

`GET` http://yourdomain/topics          => TopicsController::actionIndex
`GET` http://yourdomain/topics/{id}     => TopicsController::actionShow
`POST` http://yourdomain/topics         => TopicsController::actionCreate
`PUT` http://yourdomain/topics/{id}     => TopicsController::actionUpdate
`DELETE` http://yourdomain/topics/{id}  => TopicsController::actionDelete

2. Specified parameters

'resources' => array(
    'topics',
    array('posts', 'only' => array('index', 'create')), // just bind PostsController::actionIndex, PostsController::actionCreate action
    array('users', 'except' => array('delete', 'update')), // except UsersController::actionDelete, UsersController::actionUpdate action
),

ChangeLog

Version v1.0.1 and v1.0.2, (*4)

  • Added composer supported
  • Added namespace supported

Version v1.0.0, (*5)

  • First release

The Versions

30/03 2014

dev-master

9999999-dev https://github.com/tlikai/yii-restful

Yii RESTful URL Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii restful

30/08 2013

v1.0.2

1.0.2.0 https://github.com/tlikai/yii-restful

Yii RESTful URL Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii restful

30/08 2013

v1.0.1

1.0.1.0 https://github.com/tlikai/yii-restful

Yii RESTful URL Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii restful

22/08 2013

v1.0.0

1.0.0.0 https://github.com/tlikai/yii-restful

Yii RESTful URL Manager

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii restful