3 Replies - 963 Views - Last Post: 11 August 2011 - 07:15 AM Rate Topic: -----

#1 jtrulen   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 01-February 11

PHP Development - Best Practices

Posted 10 August 2011 - 04:49 AM

Good morning everyone,

I have been doing PHP development professionally for about 3 years now, but lately have been going back and looking at my coding practices and cant help but wonder if I can drastically improve my performance and competence by changing how I develop.

Specifically, what is the recommended coding style for PHP?

Currently, I do most of my coding inline with HTML rather than segmenting the PHP into separate files that are then included on the HTML page. I have been browsing DIC for some time now, and have noticed that a great deal of developers break out their code into separate pages rather than the approach that I take.

If anyone could comment, that would be great.

Thank you,
jtrulen

Is This A Good Question/Topic? 0
  • +

Replies To: PHP Development - Best Practices

#2 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4278
  • View blog
  • Posts: 13,571
  • Joined: 08-June 10

Re: PHP Development - Best Practices

Posted 10 August 2011 - 05:11 AM

View Postjtrulen, on 10 August 2011 - 01:49 PM, said:

Specifically, what is the recommended coding style for PHP?

cf. Userland Naming Guide and Coding Standards


View Postjtrulen, on 10 August 2011 - 01:49 PM, said:

Currently, I do most of my coding inline with HTML rather than segmenting the PHP into separate files that are then included on the HTML page. I have been browsing DIC for some time now, and have noticed that a great deal of developers break out their code into separate pages rather than the approach that I take.

as far as I know, best practice is to take the PHP files as "base", build the HTML code within that and then send the created HTML to the output device (e.g. echo).

This post has been edited by Dormilich: 10 August 2011 - 05:13 AM

Was This Post Helpful? 0
  • +
  • -

#3 jtrulen   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 01-February 11

Re: PHP Development - Best Practices

Posted 10 August 2011 - 11:40 AM

Thanks for the reply Dormilich.

Links were helpful, and it seems that I do conform to at least 90 - 95 % of the industry standards.

Going off of your suggestion of using PHP as the base then adding HTML, I will look into that as compared to what I am doing currently.

Thanks much for your help.

This post has been edited by jtrulen: 10 August 2011 - 11:40 AM

Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12769
  • View blog
  • Posts: 45,954
  • Joined: 27-December 08

Re: PHP Development - Best Practices

Posted 11 August 2011 - 07:15 AM

We have a tutorial on code separation that you may find helpful.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1