Re: [SMARTY] standart plugin(s) suggestion
| From: | Andr� Rabold | Date: | Wed, 19 Feb 2003 08:36:48 +0000 |
| Subject: | Re: [SMARTY] standart plugin(s) suggestion | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7858@lists.php.net to get a copy of this message | ||
Hi Matthias,
"Matthias Mohr" <MMohr@sysdesign-edv.de> schrieb im Newsbeitrag
news:003201c2d792$9f2c41b0$7600a8c0@mohr.loc...
> > Nice idea, so I have tried to implement such a plugin function and added
it
> > to the Wikki:
> >
> > http://smarty.incutio.com/?page=SmartyPlugins
> Looks good!
>
> Here are a few notes (which are only suggestions, no "laws"-my knowledge
> about that things are not so good, so I may be wrong :-)
> - wouldn't it be better to do the $version-tests after converting it to
a number?
> Then you could do tests like "if( $version_nr >= 4 )";
> then the code would also work for HTML-version v4.0 (I don't know if
there
> is a difference between a DOCTYPE with 4.0 and one with 4.01)
I have searched for the HTML versions and only found 4.01, 3.2 and 2.0. All
other
version specifications were superceded.
So using 4.0 isn't correct I think?! In this case it would be wrong to use
the DTD of
4.01. This is the reason why I check the strings and not the integer value.
> - make the tests for the type case-insensitive: if ( strtolower($type)
== "strict" )
Oops, you are right.
> - as far as I know, $dtd= true and $html="HTML" and $version >= 4 and
> no $type set should lead to an "strict"-DTD string
Why? I thought most of the users don't create strict HTML output. So using a
strict
doctype could lead in errors with validating browsers. This is the reason
why I used
Transitional by default.
> - as far as I know, the case of the DOCTYPE-string matters "officially"
(but at least
> Mozilla ignores it as you can read at
>
> http://www.mozilla.org/docs/web-developer/quirks/doctypes.html )
> But I think it would be best to let the generated string look
"officially" :-) (that means
> write "html" as "HTML"; make sure, that $html is always in uppercase
and that
> $type is always written with first letter in uppercase, the rest in
lowercase)
I have checked this again and here's what I've found: w4.org uses "HTML"
(uppercase) for
HTML doctypes and "html" (lowercase) for XHTML doctypes. Don't know why but
I have
implemented this check now :-?
Bye,
André
(Newest update can be found on the Wiki page)
>
> with regards,
> Matthias
>
>