setContent('Hello World!'); $template->render(); ?>
'My Page Title', 'content' => 'This is the content of my page.' ]; $template = new Template('template_file.php'); $template->setContent($data); $template->render(); ?>In this example, we pass an array of data to the setContent method. This data can be used in the template file to dynamically populate the HTML elements. Package library: PhpTemplate