Data storage: Reading and writing to the file system, physician JSON
Getting data from a file or a database requires a solid understanding of arrays and loops. If you’re still unclear about arrays and loops, now is the time to review! Watch Chapter 4, “Working with Multiple Values in Arrays and Loops” in PHP for Web Designers on Lynda.com.
Write a brief response and brainstorm interesting, wacky, innovative ideas for projects using APIs — not something you’d make in this class (necessarily) but big ideas. For more info about APIs, see the “Tech prep” section below.
Create an application that stores data in the file system in JSON or CSV format and retrieves that data for display on the front end. You may continue with your application from the past weeks or move forward with a new idea.
Due next week (2/25). Blog write-ups due 8pm Feb 24.
Tech prep for next week
- What is an API? video on Lynda.com (2m 43sec)
- Notes on JSON, XML, and APIs
- Using APIs
- About the Sunlight Foundation API: http://training.sunlightfoundation.com/module/unlocking-api/
PHP Object-Oriented Programming
PHP has an entire system of Object-Oriented programming, using classes and objects, similar to what you’ve seen in Processing. We’re not going to go deep into OOP in PHP in this class, but in order to parse JSON, which will be doing with APIs, you’ll need to be familiar at least with what an object looks like in PHP. For an overview of objects in PHP see this tutorial. Read at least through the section “Defining Class Methods”.