greetings again glynco, , you seem to be trying to learn about making a programming "Structure" for the MVC using OOP as in the Tutorial you gave a web link for. You are trying to do a substitution for the tutorial return array, it seems you do not understand some of the core programming methods for Arrays and Objects in PHP. It looks like you changed the tutorial "Books" naming convention to "Articles" naming for your instance. They have this code -
return array( "Jungle Book" => new Book("Jungle Book", "R. Kipling", "A classic book."), "Moonwalker" => new Book("Moonwalker", "J. Walker", ""), "PHP for Dummies" => new Book("PHP for Dummies", "Some Smart Guy", "") );
Which you seem to want to KNOW how that code works and to have it be useful to you for your Articles Object. However, The tutorial does NOT do a good job of showing you how to use Object storage for Items (books, Articles, etc.) and using a VIEW class to list the storage Items.
You may need to learn about Array and Object methods before you get into MVC programming.
Member_2_248744
Oh sorry, I do not have time today, but tomorrow, maybe some php object code for this sort of thing.
Open in new window
and here is the articlelist.php
Open in new window