use SimpleTemplate\Template; $template = new Template(__DIR__.'/templates'); $data = [ 'title' => 'My Page Title', 'items' => [ 'Item 1', 'Item 2', 'Item 3', ], ]; echo $template->render('page', $data);In this example, we're using the SimpleTemplate package library to render a template called 'page'. The template is located in the 'templates' directory, which is passed to the Template object when it's created. We're also passing some data to the template in the form of an array. This data includes a title and a list of items. The template can then use this data to render the page. Overall, using a PHP Template render library like SimpleTemplate can make your code more organized and easier to maintain. It's worth exploring different libraries and finding one that works best for your needs.