L
L
Lumore2014-12-19 19:10:10
PHP
Lumore, 2014-12-19 19:10:10

What is the best way to create pages?

How best to create pages:

  • for each file, for example, for the registration page - sign-up.php
  • create a file "page.php" and display the content through "name", for example " mysite.ru/page.php?name=sign-up "

Then I will make the links readable in htaccess using the Rewrite Rule.
In the second example, it is convenient, but the file will weigh a lot, because it will contain the code of several pages. Is it good or bad?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav, 2014-12-19
@Lumore

Better read about MVC goo.gl/abEnjF

F
FanatPHP, 2014-12-19
@FanatPHP

What?! CONVENIENTLY? You didn't make a reservation? Pushing the code of different sections of the site into one file is, in your opinion, U-D-O-B-N-O?!!!
Ah, well, yes. If you have each section consists of one and a half lines - then yes, probably. Although all the same - an extra if for each section ...
Not. You have this file only in your imagination. Well, do it in reality, work with such a monster for a day, and any ideas about its "convenience" will fly out of your head.
And yes, it's useful to read about MVC. You will not understand anything, but you will know what to strive for in the future.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question