This example uses the framework Toy-PHP (https://github.com/Mortaro/Toy-PHP) and the lib Towsta-PHP (https://github.com/Mortaro/Towsta-PHP). To start a project like this, just clone the template of Toy-PHP, clone Towsta-PHP inside the folder "lib" and read the tips below.
This is the modules folder generated by Towsta-PHP, here you can add your own functions inside each class, or simply leave it like that.
Here you synchronize with the Towsta's API and pass the fetched objects to a view. The URL "/books" will synchronize all the books from Towsta Manager's module, while "/books/123" will only synchronize the book with "123" as id.
Here is how you show the items from a Towsta's module in your website. The "views/layout.php" remains untouched since it's not important for this tutorial, the "views/books.php" is a foreach()
over all()
the synchronized objects displaying them as HTML, and the "views/book.php" shows the first()
and only synchronized object as HTML.