Summary

In this chapter, we created api for use in a mobile app through the use of the powerful tools provided by Yii. We adopted the approach of creating a new application in order to distribute RESTful web services, instead of mixing web and api controllers. For this purpose, at the beginning of the chapter, we configured a new REST application using the advanced template.

After configuring the RESTful web service environment, we discovered two kinds of api controllers that Yii provides by default, then we created controllers with custom data and data from ActiveRecord.

Next, we found out the default authentication methods for RESTful Web Services provided by framework and you learned how to use them.

Finally, we focused on how to customize the ...

Get Yii2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.