Template in the CakePHP 4 is a .php file where define the HTML layout of the page. Template files automatically get loaded on the page. For this need to create files in a specific pattern.
From Controller, you can pass data to the template file.
In this tutorial, I show how you can create template files and pass values from the controller to the template in CakePHP 4 project.