How to add a Twig extensions with a custom function to the Symfony framework fullstack Sulu CMS. In this PHP tutorial Roland Golla shows how to implement a own Twig function to a template. You will learn a actual usecase for the YouTube API, how to implement a webservice directly to the twig template to render content from an API to the HTML frontend.
See more PHP live coding videos
How to build a website from scratch in 2 hours
Part 1 Sulu CMS setup with DDEV
Gitlab pipeline with Codeception tests full example
00:00 Intro Twig extension with Symfony Sulu CMS
01:05 Custom Twig function for the YouTube API usecase
01:47 Start task from linux terminal with a new Git branch
03:00 Add PHP file for a Twig extensions
07:36 Sulu content element configuration for YouTube playlist id
10:08 Twig template with function of the PHP extension
13:34 Login to Sulu content management system admin area
15:27 Full example for Twig extensions and YouTube API on GitHuib open source project
17:06 Best practice twig templates on sulu.rocks core developer example
17:45 Offical Symfony documentation “How to write a custom Twig extension”
18:06 Outro with helpfull links
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Our NCA Event Highlights & Live Sessions:
This post was automatic generated with this wp-automatic-plugin
You should try vue.js. In my optinion it feels like Twig in the frontend.