PHP coding standards

前端 未结 5 1741
猫巷女王i
猫巷女王i 2020-12-17 20:28

I\'ve been looking for some guidelines on how to layout PHP code. I\'ve found some good references, such as the following:

http://www.dagbladet.no/development/phpcod

5条回答
  •  粉色の甜心
    2020-12-17 20:51

    I usually try and follow the standards that are set by the language's core libraries.... oh wait.

    Seriously through - you should try and follow the MVC pattern in any web application as it is pretty much standard practice regardless of language. In PHP this can be achieved in a quick-and-dirty way by treating index.php as your controller and separating data logic and presentation by file. This small step will at least let you move your code to a full featured framework when and if you choose.

提交回复
热议问题