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

Chapter 8. Building an API for the CMS

Throughout this book, we've covered the development of view-oriented applications—applications that the user can interact with directly. Our view-oriented approach, however, doesn't allow us to easily integrate with other services or provide functionalities for native applications. This view-oriented approach often leaves us with hardcoded functionality and makes integrations significantly more difficult. The Yii framework, however, is extremely adaptable and enables us to build API-driven applications rather than view-driven applications. An API reduces the amount of code we have to maintain; if executed properly, it reduces the amount of code that needs to change when we want to add a feature. Ultimately, this allows us to work faster and be more adaptable to changes.

Building an API-driven application also enables us to easily develop both web and native clients that work with our API, thus completely separating view-oriented logic from our application...