php - Is-it worth to split a page into many pages? -
I got a question about php and pages: Is this code split into several other files? So in the end, index.php will be made of:
include 'footer.php'; 'Header.php' is included; Include 'home.php'; Include 'load.php'; [...]
Should I put all code in a unique page?
Other questions, if I include a php page, then all the wars can be made, the included page should be used in the main page, or should I use $ _SESSION?
Thank you for your help!
This is the value for your main question. In fact, if you do not follow this method for a long time So it will be a pain to manage your web page for you. I am not a php guy but I can tell you this because it is a universal truth that thoughts have to be written here once and there is necessary use anywhere. You do not want to write like this repeatedly, right? This is the reason that we produce functions while programming, we define a function and use it as often as we want. Now consider that you have suddenly noticed that you need to make some modifications, because you have created a function, you can only make changes in one place and without the code of the function, without touching a line of code it is everywhere Will be reflected. There is a constant in real project change, that is why we find many design patterns in software industry such as MVC.
In web projects, most (not always) titles, navigation, footers on all pages are the same, therefore, you should consider creating separate files for these items, and you should always It should be in your index.php file which is unique to the index page.
Comments
Post a Comment