Welcome Guest, Not a member yet? Register   Sign In
document_head class
#1

[eluser]TheFuzzy0ne[/eluser]
Hi everyone. I'm thinking about creating a document head class, which will manage everything between the <head></head> tags. When you want to render the page, it will return a string containing everything you've added contained between <head></head> tags.

It will support functions such as addMeta, addScript, AddCss etc...

Some functions will have an alternative which works in a different way. For example, addScript will have a similar function named addScriptFile.

addScript will simply take a heap of JavaScript code (which can be dynamically generated, or read from a file), and include it inline, between tags.

addScriptFile will essentially be the same, only it will take a URL to the JavaScript file, which will be inserted again in script tags, but it will add the "src" attribute to it.

Would anyone like to use anything like this, or am I not thinking along the right lines here? Personally, I think it allows for much more dynamic content, and a convenient place to keep everything stored until rendering time.

I'd be interested to hear your thoughts.


Messages In This Thread
document_head class - by El Forum - 04-29-2008, 06:29 AM
document_head class - by El Forum - 04-29-2008, 06:38 AM
document_head class - by El Forum - 04-29-2008, 07:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB