5
5
50VAJJ2017-07-08 12:20:10
PHP
50VAJJ, 2017-07-08 12:20:10

Why split a site (PHP)?

Hello.
I'm watching PHP tutorials. There, everyone separates the main file (index.php) into header.php and footer.php.
How is this better than writing everything in one main file (index.php).
I mean files with HTML code, not functions, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-07-08
@BorisKorobkov

Flies - separately, cutlets - separately.
1. Website design (header/footer) is one thing, content (index) is another.
2. There are usually more than one page on the site. Often thousands. In order not to duplicate the same thing in each.
By the way, whether to divide into header and footer is a moot point. In my opinion, it is more correct to make one wrapper template and insert content from index.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question