Skip to content

oceanquest/aweComponent1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Component 1 - Task

Currently index.php will display 2 tables and a form. Each table refers to a product type in a json file (Cds and Books).

Component 1 is about setting up your development environment, linking code to GIT, demonstrated through a short PHP task.

You are to add a new product type - GameProduct. This will follow the same format as the other products and extend the ShopProduct class. It's unique property will be 'pegi'. The form should allow for products of this type to be entered.

The end result could take a form similar to:


Additional Notes

This is a simple PHP project based on the example code in the Matt Zandstra book PHP Objects, Patterns and Practice.

The code uses a json file to store some products which then has the option of being passed back as a response as

  • HTML -> Using HTMLProductWriter Class
  • JSON -> Using JSONProductWriter Class

The HTML writer (accessed through index.php) includes a form that will when submitted will POST data to the server which will be written to an updated JSON file (products.json).

GET variables are

  • delete remove product from json file
  • api specify whether this is an API type request to return data as a json string

To Note - the json file could have been returned directly but this step is there to help visualise API writing methods if calling data directly from a database.

This project is lightweight and has no error checking.

About

Template repository for TBC BSC L6 AWE component 1.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published