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 ships with its own simple PHP templating system and also has built-in support for the very popular Blade and Twig templating engines.
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.