lead smarty to W3C standards
| From: | Peter Turcan | Date: | Thu, 20 Feb 2003 08:25:45 +0000 |
| Subject: | lead smarty to W3C standards | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-7975@lists.php.net to get a copy of this message | ||
Dear group.
In relation to my previous mail...
I have found, that for example {mailto} plugin generates HTML code,
which can't be validated against XHTML validator. Why?
- in XHTML specification, all tags has to be lower cased
- in <script> tag should be:
<script type="text/javascript">
//<![CDATA[
eval(unescape('%64'))
//]]>
</script>
I suggest to create smarty's internal variable. For example html_ver
with (for example) these possible values:
"10" = HTML4.01 frameset
"11" = HTML4.01 transitional
"12" = HTML4.01 strict
"20" = XHTML 1.0 frameset
"21" = XHTML 1.0 transitional
"22" = XHTML 1.0 strict
"30" = XHTML 1.1
"90" = XML
.....
then some declarations... in Smarty.class.php
define("HTML401_FRAMESET","10");
define("HTML401_TRANSITIONAL","11");
define("HTML401_STRICT","12");
define("XHTML10_FRAMESET","20");
define("XHTML10_TRANSITIONAL","21");
define("XHTML10_STRICT","22");
define("XHTML11","30");
define("XML","90");
...
base on html_ver variable there will be dependencies of printing of
tags (in mailto) in smarty.
And also the simmilar variable (encoding or charset) which value will be
used in parameters of meta (content-type) and maybe in HTTP-HEADER
In your code for example:
$smarty->encoding = "UTF-8";
1a. So example of my idea in PHP source:
$smarty->html_ver = HTML401_STRICT; //assign HTML version
$smarty->DocHeader(); //print correct doctype header
1b. or simple:
$smarty->DocHeader(HTML401_STRICT); //print correct doctype header
2. OR IN TEMPLATE:
{docheader version="HTML401_STRICT"}
in the "1b" case, DocHeader function must set html_ver variable also.
what do you think of that?
Peter