Does php have a master page similar to. net,
The page header (navigation bar) and footer (copyright information) of all pages on the website are the same, and the page header and footer of all pages in a file are changed automatically.
I didn't understand php at the beginning. I hope to explain it in detail. thank you!
Reply to discussion (solution)
Write the header and footer of the page into two public files. other files only need to be included.
Write your navigation page and footer as a php page or tpl template page
Then you can include the required page.
For example, include ('menu. php'); menu. php is your navigation page
Write your navigation page and footer as a php page or tpl template page
Then you can include the required page.
For example, include ('menu. php'); menu. php is your navigation page
Written as a php page, menu. php (Template page), it is necessary to use Smarty to separate the code and html, and then reference menu. php on other pages. You can also use menu.html (html navigation page) directly on other pages ).
The tpl Template page does not know. it is better to solve the problem by using two sections of code.
By the way, we recommend several lightweight code editors, so zend studio will not recommend them,
Vim was very powerful, but I was a little dizzy. Sublime Text 2 and Notepad ++ are very useful. Are there any lightweight code editors that are useful?
The code editor is usually used to EditPlus on win.
It's easy to make vi simple... if vim is dizzy, don't try vi.
Notepad ++.
Of course, I have to recommend phpstorm for ide.
By the way, we recommend several lightweight code editors, so zend studio will not recommend them,
Vim was very powerful, but I was a little dizzy. Sublime Text 2 and Notepad ++ are very useful. Are there any lightweight code editors that are useful?
Don't talk about IDE and code editor.
Help me solve the following problem first
????????????????????????
Reference the reply on the second floor:
Write your navigation page and footer as a php page or tpl template page
Then you can include the required page.
For example, include ('menu. php'); menu. php is your navigation page
????????????????????????
Written as a php page, menu. php (Template page), it is necessary to use Smarty to separate the code and html, and then reference menu. php on other pages. You can also use menu.html (html navigation page) directly on other pages ).
The tpl Template page does not know. it is better to solve the problem by using two sections of code.
My personal habits are to include a page directly. There is no need for Smarty or html separation. In fact, it depends on how complicated your content is. if you just navigate some copyright information, isn't it more complicated?
Of course, you can simply use html, unless you do not want to make those who are not logged in can't even see the navigation.
Do you need code? In this case, you only need to include this file.
Include
Forgive me or master
= Php still does not have a master page