php how to make a template

Solutions on MaxInterview for php how to make a template by the best coders in the world

showing results for - "php how to make a template"
Vicente
18 Feb 2017
1<?php
2  	include(TEMPLATE_DIRECTORY . "header.php");
3	include(VIEW_DIRECTORY . "somerandompage.php");
4	include(TEMPLATE_DIRECTORY . "footer.php");
5
6	/*
7    	The header.php file would include all your navigation, head elements,
8        script links, and anything that should be displayed before any content.
9        
10        The somerandompage.php is your content for that page (can be anything,
11        basically anything that is unique to that particular page
12        
13        The footer.php file would include all your footers, end of HTML tags,
14        and anything that should be displayed after any content
15    */
16?>
Jessica
08 Jun 2019
1PHP Templates is a broad term. You could mean a templating engine like Blade or Twig which makes embedding PHP into HTML easier and safer by providing protections against XSS. You could also mean PHP Frameworks like Laravel and PHPCake which make writing PHP code much easier and in a well structured way (MVC usually)