This Yii 2 RESTful guide is suitable for beginner level web, Yii 2 RESTful API developers.

Yii 2 RESTful Web Services guide

RESTful setup

Setting up Yii 2 restful from basic controllers and models to more complex data manipulation.

The basic CRUD functionality of Yii RESTful web services.


The tricks of user authentication and user authorization:  how users can register and log in your app via the RESTful API.

Relational data

How to implement relational data models.

Response formatting

Yii 2 RESTful API content negotiation.

How you can convert resource objects into arrays.

How you can convert arrays into a string in the format as determined by the content negotiation step.

Error handling

How to catch and identify the cause of any errors that may result due to user requests or any abnormalities on the server.


How you can manage the REST API data resources which include working on resource objects, fields and links.

Overriding Yii 2 methods and properties

How you can override default controllers’ or models methods and properties.

Some coffee for me won’t be bad 🙂