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 response output format, taking an example of how to create an RSS version of the available data.

In the next chapter, you will learn how to write a console application and will look at the differences between web and console apps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.42.196