I've been using it for a long time. NET Web site, recently started to learn PHP, have encountered problems, please help to see how to solve
Before the. NET small Web system, the master page has a region dedicated to displaying the login username, IP, etc.
However, because there is no master page in PHP, so I would like to write a general layout of a page (hereinafter called master.php), in other pages include, is equivalent to the implementation of the "master page" function, but encountered the following problems:
Since master.php writes only layouts, how should the content that is actually displayed in different pages be put into the master page?
such as in C #, the master page has Asp:contentplaceholder
And I'm now writing a layout in the master.php, the controls that are written on the new page are all outside the master.php area (the display is messy anyway, because the control is not placed at the correct location), I would like to ask how this problem solved
Or is there a more common and better way to achieve this effect? Thank you first.
Reply to discussion (solution)
Either use the inheritance in the framework or implement the inherited function yourself, or you separate the layout and include it in the Include
Consider using the Smarty template
Use the include bar, or refer to TP has a template inherited things (not used template inheritance)