Yoyo is a full-stack PHP framework to create rich, dynamic interfaces using server-rendered HTML. You keep on writing PHP and let Yoyo make your creations come alive.
Yoyo is kinda like Laravel Livewire and the Craft CMS Sprig plugin, because it's inspired by them, yet totally different since it's not bound to a specific framework nor CMS. You can use it on any project 🚀
Yoyo ships with its own simple PHP templating system and also has built-in support for the very popular Blade and Twig templating engines.
Yoyo uses and extends htmx to bring modern browser features to HTML so you don't need to write Javascript, unless you want to.
Ok, how easy are we talking here?
Really easy! Just take a look at the code below where you can see a reactive Yoyo component, made of a class and a template, that increments a counter without page reloads.
And the template:
Finally, to show the component anywhere on the page:
So, how does it work?
- Yoyo renders the initial state of a component on page load.
- When an interaction takes place, an ajax request is sent to a Yoyo route.
- Yoyo processes the data and returns an updated component HTML partial.
- Finally, the updated component HTML is seamlessly merged into the page.
All of this takes place without page re-loads, offering a smooth, and slightly magical, user experience.