Added a model function and controller php code to view list of items