Skip to content
Advertisement

[HTML/CSS/JavaScript/PHP]: In which order code must be written?

While writing code in a file that would comprise of PHP, HTML, CSS & JavaScript, in what order each must appear? What are the best practices for separating the presentation and the logic?

Sometimes external .js and other files are using in the link tag. Where these link tags must appear?

Advertisement

Answer

This doesn’t answer the question directly but the article that Rasmus Lerdorf (creator of PHP) wrote has some nice examples to follow.

Clean and simple design. HTML should look like HTML. Keep the PHP code in the views extremely simple: function calls, simple loops and variable substitutions should be all you need

http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement