Skip to content

DeprecatedMortaro/Towsta-PHP-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Understanding the Example

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.

About "modules" folder

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.

About "index.php"

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.

About "views" folder

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.

About

Website example using Towsta-PHP and Toy-PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages