Well, if you meant $var = 'html' or return 'html', sure. Other than that there is no diff. I just find syntax highlighting to be useful![]()
| SitePoint Sponsor |





Well, if you meant $var = 'html' or return 'html', sure. Other than that there is no diff. I just find syntax highlighting to be useful![]()


That's a good point. Are there any good standardised OOP techniques that allow for proper highlighting of HTML code?
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript





Any particular examples? Keep it short I guess, ie make methods that deal with form elements, rather than the whole form.


Sorry, I'll try to be more clear.
I'm wondering if there are any PHP coding techniques that allow us to use HTML code in such a way that it is not output immediately to the screen (thus satisfying OOP techniques) while also allowing the HTML code to be syntax highlighted by our code editors (thus satisfying our sense of readability).
Edit: s/out/our
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript











You have to think of interface first.
First figure out what html you want and what happens if user click a link.
After this you can ask for the SQL query.





Hey Paul.but only when you're not planning to store the html code for later use.
But why we need that?
In the proper planned application we have all HTML in one place - in the template. And only use for it is output.
And template is more HTML than any other language - another reason to use third method.


Yep, links need to jus retrieve data fro the database (be immutable), because spiders will be crawling all over them and people can bookmark them and perform other crazy stuff with them.
Buttons are for actions that cause a data change to the server, whether they create, update, or delete information in the database.
Yeah, *hangs head* - I was using CRUD there.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript


Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript








Unlike desktop application, web application has discrete nature.
Actually, each page acts more like separate application than part of main program.
Therefore, if you have a link on your page, which leads to another page, there are two separate programs to run. And second one don't have access to first one's data and you have to fetch it again. So, no need to fetch actual prices on the first page and there is no use for oddz's query.
On the other hand, if you plan to fill some javascript array with this data and use some DHTML action instead of a hyperlink, you will need all your data. So, there is use for oddz'q query.
That's why you have to go for interface first.
I apologize for my crude English. Such explanations are quite complicated for me.
Never rely on javascript being enabled on a given computer. Any web page or web app should be able to function (albeit slightly slower) with javascript disabled or blocked.
Community Team Advisor
Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator


Hear hear.
There is an on-going discussion/argument/dollybrook going on at the moment in the JavaScript forum about How to build a desktop like application interface using JavaScript? where the common consensus is to start with a base HTML page and use CSS for presentation. Get the application working in a non-scripted environment, and only then use JavaScript to improve the user interface/experience.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
Bookmarks