Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

My website is a bootstrap html/css static website. What I would like to do is create template files of my header.tpl, navbar.tpl, footer.tpl for example (20 pages, one alteration to a navbar I don't want to edit 20 html files). First of all, could someone very quickly explain to me the php line to echo a template file where I would like it to render the code on the webpage?

Secondly, I have a question with regards to the navbar. For each different page, I would need the menu item that corresponds to that page, such as the 'about us' page, to have an li class 'active'. How can I do this with php so that the active class changes to the page that the user is on?

Could someone give me some insight into how to solve this. I am a php learner at the moment! Thank you!

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.