I have no idea if there is a technical term for this, so I did not find anything on Google and this site.
My friend, who has been creating websites for many years and actually creating a business, uses a rather unique (for me) system.
It splits its page into 3 parts, a headline, a body and a footer. Inserts them into 3 files, and then includes the header and footer on the body page, leaving only this: (example)
<?php include_once "Constants/Header.php"; ?> <div id="Container"> <div id="Header"> HEADER </div> <div id="Menu"> <ul id="Nav"> <li>Menu item</li> <li>Menu item</li> <li>Menu item</li> <li>Menu item</li> <li>Menu item</li> <li>Menu item</li> </ul> </div> <div id="Body"> </div> </div> <?php include_once "Constants/Footer.php"; ?>
Is it good to code the site this way? So why? Last but not least, do you code your pages this way?
, PHP . , , , , include , sitewide, Model-View- .MVC, , (, , ..), . "" -, "" ( ), "" .MVC, . . , " ", . - PHP, MVC, (, CodeIgniter)., MVC " " - , . (-, ) include ( ) .
include
( ) include PHP. , , , , .
, include.
, , , .
, .
, . 3 , , , (: index.php), , .
<?php $active_page = $_GET['page']; require_once('header.php'); require_once($active_page); require_once('footer.php'); ?>
, PHP. , .
, . , -, . , . script, - script. ( , , ).
, - , . . PHP. , , PHP-, PHP HTML .
PHP - - CMS. (, , , , ), CMS, Wordpress, Joomla, Drupal, DLE. - , , - PHP, MVC, Zend - ( ), CakePHP, CodeIgniter Symfony.