I used to develop websites the following way:
footer.php
header.php
navigation.php
index.php
contact.php
Doing it this way allowed me to only make changes in one place. For example if I wanted to change footer information. All I would change is footer.php
I don't want to use php to do this anymore. What are someone of the alternative solutions to creating a flexible website structure. Would node.js
achieve this?
Sure, node.js has awesome web frameworks and templating languages. The biggest difference will be that instead of maintaining a set of documents (header, footer, index, contact) served from a web server, you'll be writing a server itself that can route URLs to functions. It's a bit of a paradigm shift, but it it gives you a lot of power, and flexibility.
My favorite node.js web framework is ExpressJS. Welcome to the node community!
[Edit: To clarify, I understood you to mean, "I don't want to use PHP in this manner," as opposed to, "I don't want to use PHP at all." If you actually did mean the latter, then please ignore this answer... :)]
node.js is not a web server, and is completely the wrong tool for what you're looking to do. It seems you've done enough development of this sort of site to have learned the limitations involved. That's good, so I think the next logical step for you would be to learn an MVC framework like Fuel
, Symfony
, CodeIgniter
, or Zend
.
Ruby on Rails for the win! personally i find php to be poisionous these days, but i did it for many years...it depends though on your ability to adapt to a new language and your level as a programmer.
if youre really into your php skills, you can stick with Zend..
Really what you want to focus on is an MVC (Model View Controller) architecture for your designs, it breaks everything down perfectly, leaving everything to be defined once, and in its place.