PHP Novice, about PHP implementation of C # master page issues

Source: Internet
Author: User
Tags learn php smarty template
PHP novice Help, about PHP implementation of C # master page problems
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.
------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
------Solution--------------------
Consider using the Smarty template
------Solution--------------------
Use the include bar, or refer to TP has a template inherited things (not used template inheritance)
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.