Page 1 of 1
includes or embedded coding?
Posted: Thu Sep 20, 2007 3:52 pm
by webcornea
hello,
i am a programmer but i have never coded in PHP. I am building a PHP based site with thousands of pages through a friend who claims to be proficient in PHP.
Anyway, he is suggesting that we embed PHP code within the HTML files but I have heard that it is better to keep HTML and PHP functions separate.
Please advise which method is better for coding and any input you guys can give will be great. We just want to be build an efficient site that we can easily update the design and code.
Thank you
Posted: Thu Sep 20, 2007 4:30 pm
by Mordred
Templates. Most definitely templates. If you want efficient, stay away from homebrew template engines (i.e. don't do it yourself, you're going to make a mess out of it, no offense).
Posted: Thu Sep 20, 2007 4:54 pm
by feyd
Very similar thread from today...
viewtopic.php?t=73973
Posted: Thu Sep 20, 2007 5:22 pm
by webcornea
yea, i am not talking about simple headers/footers. i know they can be common through 1 file.
i am talking about complicated function calls and other php functions. please advise. the first reply was useful but he did not really give pros and cons for each type of coding.
please advise
thanks
Posted: Thu Sep 20, 2007 6:01 pm
by feyd
He shouldn't have to list the pros and cons. Your own research should tell you enough. We aren't here to spoon feed you an answer.
Many template engines (ignoring that PHP is one) can run many native functions, however true templates shouldn't need overly complicated things in them like function calls. They are supposed to be straight forward so they are easily modified. The things filling the data it works with can be as complicated as one wishes however. If the template has to know about the inner workings of things beyond the basics, it probably needs further refinement upstream.
Posted: Thu Sep 20, 2007 10:19 pm
by webcornea
feyd wrote:He shouldn't have to list the pros and cons. Your own research should tell you enough. We aren't here to spoon feed you an answer.
Many template engines (ignoring that PHP is one) can run many native functions, however true templates shouldn't need overly complicated things in them like function calls. They are supposed to be straight forward so they are easily modified. The things filling the data it works with can be as complicated as one wishes however. If the template has to know about the inner workings of things beyond the basics, it probably needs further refinement upstream.
if you cannot help then keep your mouth shut.
i am not asking to be spoon fed, simply asking for preferences based on experience.
Posted: Thu Sep 20, 2007 10:26 pm
by feyd
webcornea wrote:if you cannot help then keep your mouth shut.
i am not asking to be spoon fed, simply asking for preferences based on experience.
I've provided enough help for you, which you have chosen to ignore because you think it was about headers and footers. Here's a hint: it's not.