Welcome Guest, Not a member yet? Register   Sign In
Doctype and HTML helper
#1

[eluser]theprodigy[/eluser]
I'm building a template library for myself and noticed that some of the functions in the HTML helper do not take the doctype into consideration.

When outputing the meta tags and style sheet link tags, if you are using XHTML doctypes, then the HTML helper functions are just fine, but if you have a HTML 4.01 doctype, then these functions won't output HTML 4.01 style tags. They still output self-closing tags (<meta .... /&gtWink. These type tags will not validate in HTML 4.01.

This may not affect many people as HTML 4.01 doctypes are not used much anymore, and in order to get browsers to render it, you have to explicitly set it, but the fact that the HTML helper function doctype() still accepts HTML 4.01 as an option, it would be nice to be able to pass something into the other functions that will help this doctype pass validation.

Have I missed something in the User Guide? Is this already available? Is there a quick fix for this?

Thanks
#2

[eluser]Dam1an[/eluser]
I'm guessing there are 2 reasons for this
1) You may use HTML helper functions without using the doctype function
2) It's a helper, not a library, so setting the doc type has no effect outside of that single call
#3

[eluser]theprodigy[/eluser]
I understand that it doesn't check the doctype function since calling the doctype function doesn't set anything. Just a basic echo call.

But it would be nice to have meta($meta, "html") or meta($meta,"xhtml") with xhtml being the default if not set. Since doctype accepts HTML 4.01, why do the other html helper functions not accept it?




Theme © iAndrew 2016 - Forum software by © MyBB