$template = new Template("myTemplate.html"); $templateName = $template->getName(); echo "The current template being used is $templateName";
$templateLoader = new TemplateLoader("templates/"); $template = $templateLoader->loadTemplate("home.html"); $templateName = $template->getName(); echo "The current template being used is $templateName";This code uses a TemplateLoader to load a template file named "home.html" from the "templates/" directory and retrieves its name before printing it. The Template and TemplateLoader classes are typically part of a package or library that deals with server-side templating in PHP, such as Twig or Smarty.