Skip to content

PHP code snippet – How to make a template?

<?php
  	include(TEMPLATE_DIRECTORY . "header.php");
	include(VIEW_DIRECTORY . "somerandompage.php");
	include(TEMPLATE_DIRECTORY . "footer.php");

	/*
    	The header.php file would include all your navigation, head elements,
        script links, and anything that should be displayed before any content.
        
        The somerandompage.php is your content for that page (can be anything,
        basically anything that is unique to that particular page
        
        The footer.php file would include all your footers, end of HTML tags,
        and anything that should be displayed after any content
    */
?>
See also  PHP code snippet - How to know the path of in linux?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.