RSS feeds are a form of web services, as they provide a service, over the web, using a known format to expose data. Due to their simplicity, they are a great way to introduce us to the world of web services, particularly as CakePHP offers a built in method to create them.
In the recipe Consuming RSS feeds with a datasource from Chapter 5, Datasources, we learned how to fetch content from a foreign RSS feed. In this recipe, will do exactly the opposite: produce a feed for our site that can be used by other applications.
To go through this recipe we need a sample table to work with. Create a table named
posts, using the following SQL statement:
CREATE TABLE `posts`(posts `id` INT NOT NULL AUTO_INCREMENT, `title` ...