Book Image

Yii Project Blueprints

By : Charles R. Portwood ll
Book Image

Yii Project Blueprints

By: Charles R. Portwood ll

Overview of this book

Table of Contents (15 chapters)
Yii Project Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Describing the project


In this chapter, we'll be building an API module for our content-management system. The development of this module can be broken down into several pieces:

  • Configuring the module

  • Extending Yii to "RESTfully" render JSON or XML instead of a view file

  • Handling data input

  • Handling user authentication

  • Handling exceptions and errors

  • Specifying what data will be returned with each response

  • Implementing authentication, deauthentication, and basic CRUD actions

Configuring the module

The first component of this project will consist of creating and configuring our module so that it integrates with our main application. Since we added the functionality that seamlessly integrates modules into our application in the previous chapter, the only work required for this section will be to clear out our module cache, initialize the module, and add in the necessary routes.

Extending Yii to render JSON or XML in a RESTful way

Since the Yii framework is designed to work with view files, we'll need...