O'Reilly logo

Learning Phalcon PHP by Calin Rada

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a fully functional REST module with Phalcon PHP

Before starting, I recommend that you use a RESTful client that will help you test things faster. Personally, I prefer DHC (it's a Chrome extension), which can be found at https://chrome.google.com/webstore/detail/dhc-resthttp-api-client/aejoelaoggembcahagimdiliamlcdmfm?hl=en.

We are going to develop the CRUD operations for Articles, Categories, Hashtags and Users. Let's start with Articles.

Articles

We have already created the controller, so by executing a GET method on https://learning-phalcon.localhost/api/v1/articles, you should get a response. Let's implement the article manager for the articles listing so that we can retrieve real data.

First of all, we will make some changes to the Article ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required