DOUBT: Division of layout

Asked

Viewed 66 times

2

I am new in the area of development and I am developing a project for learning.
Here I have a question about the layout division.
What is best practice?
Have separated the parts header sidebar footer content into different files and do include/require
Or in the index let done those parts (header, sidebar, footer) and give include/require in the content? Has differences in performance?
When should I start worrying about performance?

I thank you all for sharing the knowledge! :]

  • 1

    There is no "right" in this case, it all depends on what content you are programming. You should not worry about performance at this level. Worry about how much your options facilitate the organization of your source. Having to do 1 include or 10 no on the same page will not make significant difference to the site user.

  • Anything that repeats on multiple pages can turn to include.

1 answer

1


As I would, I would separate the header, sidebar, footer, and in a separate file my content, so would save code, in relation to performance I believe there is not much difference, the bigger question would be organization.

  • Pages
    • index
    • contact
  • Includes
    • footer
    • header
    • sidebar

Browser other questions tagged

You are not signed in. Login or sign up in order to post.