What are best practices for loading template files in PHP and accessing template functions?

When loading template files in PHP, it is best practice to use functions like include or require to bring in the template file. To access template functions, you can define the functions in a separate PHP file and include that file in your template file. This separation of concerns helps keep your code organized and maintainable.

// Include the template file
require 'template.php';

// Call the template function
echo myTemplateFunction();