I use this tools to prepare my Twig views on larger project. I still must add compilation tools and folder structure for JS and CSS.
Use Docker to point the public
folder or start internal PHP server :
php -S 0.0.0.0:8080 -t public/
Look at the Branches for different base implentations :
Place the source files in this folder :
data
: the data files corresponding the templates.views
: the Twig files you can organise has you wish but with the main templates in the root.
views/
layouts/
main.twig - The main layout to extends in templates
homepage.twig - The Homepage to display
data/
homepage.php - Return an array with the variables use in the Homepage.