Honestly I really dislike the "xhtml" type of tags in CakePHP. There
are no reasons for that, I think it would be a better idea to make it
html 4 strict.
On Fri, Dec 26, 2008 at 10:54 PM, gearvOsh <mileswjohn...@gmail.com> wrote:
> Honestly I really dislike the "xhtml" type of tags in CakePHP. There > are no reasons for that, I think it would be a better idea to make it > html 4 strict.
Everyone has reasons for and against various technologies.
Thankfully, CakePHP provides you a complete fantastic framework without limiting you to something as specific as only being able to use xhtml.
You should be able to extend the html helper for all (most?) the tags you want to produce.
Perhaps create a html4 helper:
App::import('Helper', 'Html');
class Html4Helper extends HtmlHelper {
// Implement code here, maybe sometimes as simple as replacing $tags values.
}
Good luck with it.
If you do create something that you feel does the job, submit an article to the bakery, and share your helper with the community!
gearvOsh wrote:
> Honestly I really dislike the "xhtml" type of tags in CakePHP. There
> are no reasons for that, I think it would be a better idea to make it
> html 4 strict.
Most browsers dont support XHTML and most people dont even write XHTML
correctly. If this is your site(http://www.pembo13.com/), your DTD is
XHTML but its being parsed as HTML. So basically thats kaput, did you
read the article I posted earlier?
@Graham Weldon - Seems like a lot of work to overwrite it. Actually I
dont see how that would work well.
On Sat, Dec 27, 2008 at 1:41 AM, gearvOsh <mileswjohn...@gmail.com> wrote:
> Most browsers dont support XHTML
I don't know, all the sites where I use XHTML seem to work just fine.
> and most people dont even write XHTML
> correctly.
Not exactly my problem now is it. That's kinda like saying don't do
maths because a lot of people don't do math well.
> If this is your site(http://www.pembo13.com/), your DTD is
> XHTML but its being parsed as HTML.
That's all well, and good. I prefer the markup to be as XML like as
possible. If I didn't, I'd be using HMTL.
> So basically thats kaput, did you
Fine, how does any of that stop from integrating CakePHP into your site though?
> read the article I posted earlier?
I scanned it, didn't give any reasons why HTML was better than XHTML,
just seemed to say that HTML was good enough. It went as far as
mentioning HTML 5, which is at best months away -- not relevant for
the present.
And nothing you've said so far suggests that XHTML is a bad thing,
just that HMTL is good enough. And while I'm not up to date on my
HTML, I don't think there is much in XHTML that doesn't work in HTML.
So switching to HTML would just make CakePHP useful to less people.
Not that I care... I don't think HTML vs. XHTML is that big a deal.
The only reason I replied is that I don't like the idea of people
popping into other peoples projects and saying "hey, I don't like the
way you've done this, redo it to this way that I like it".
I should not that I am in no way affiliated with the CakePHP projects,
and I speak solely for and represent only myself.
> @Graham Weldon - Seems like a lot of work to overwrite it. Actually I
> dont see how that would work well.
-- Fedora 9 : sulphur is good for the skin
( www.pembo13.com )
You would need to put the content-type as application/xhtml+xml which
in most cases breaks the layout and always breaks IE. Everyone usually
puts it as text/html which then renders the browser as regular HTML
and NOT XHTML. Im not telling you XHTML is bad, all im saying is that
in the end the browser outputs any type of XHTML as HTML 4.
In CakePHP you can "choose" the Doctypes of XHTML or HTML but the
taglist is all XHTML, which then causes markup errors.
Well I personally would say that having the taglist in XHTML / XML is
of a more global advantage ...
Since if you want to spit out XML for other Documents eg. AJAX, RSS,
and so on you need tags that confirm to XML for it to even work. And
as far as I know RSS Readers etc. wont let you get away with faulty
markup as the browsers of today are ... read the first paragraphs and
it seems to me that he is once again complaining about just how bad
the support (following of clear standards) is by the browsers of
today, and the resulting facts that developers then have to fight
endless hours to get a some what good result in most browsers and OS.
Where more than often Developers have to break with the standards to
do so, which makes the standards more sloppy! (his main complaint is
to the sloppyness of the Developers to the standards)
So if you personally want it to be clean HTML 4 strict and the taglist
is stopping you write the helper as suggested, and give it to the
community if you want.
I should note that I am in no way affiliated with the CakePHP
projects,
and I speak solely for and represent only myself.
On Dec 27, 11:22 am, gearvOsh <mileswjohn...@gmail.com> wrote:
> You would need to put the content-type as application/xhtml+xml which
> in most cases breaks the layout and always breaks IE. Everyone usually
> puts it as text/html which then renders the browser as regular HTML
> and NOT XHTML. Im not telling you XHTML is bad, all im saying is that
> in the end the browser outputs any type of XHTML as HTML 4.
> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the
> taglist is all XHTML, which then causes markup errors.
gearvOsh wrote: > In CakePHP you can "choose" the Doctypes of XHTML or HTML but the > taglist is all XHTML, which then causes markup errors.
gearvOsh, It shouldn't be too much of hassle to create a html4 helper based on the existing html helper. If you create your helper extending the existing html helper, basically all you'd have to do is copy/paste the tags array (lines 45-98 in 1.2 final) into your newly created class and change as necessary.
> gearvOsh wrote: >> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the >> taglist is all XHTML, which then causes markup errors.
> gearvOsh, > It shouldn't be too much of hassle to create a html4 helper based on > the existing html helper. If you create your helper extending the > existing html helper, basically all you'd have to do is copy/paste the > tags array (lines 45-98 in 1.2 final) into your newly created class and > change as necessary.
As a suggestion for the developers, maybe a better approach was to have some flag in the config that tells the doctype compliance mode (strict, transition for html 4.01 and xhtml 1.0).
-- MARCELO DE F. ANDRADE (aka "eleKtron") Belem, PA, Amazonia, Brazil Linux User #221105
On Sat, Dec 27, 2008 at 4:22 AM, gearvOsh <mileswjohn...@gmail.com> wrote:
> No thats the thing, XHTML is not supported.
> You would need to put the content-type as application/xhtml+xml which > in most cases breaks the layout and always breaks IE. Everyone usually > puts it as text/html which then renders the browser as regular HTML > and NOT XHTML. Im not telling you XHTML is bad, all im saying is that > in the end the browser outputs any type of XHTML as HTML 4.
So... then there is no reason for me to not use it then.
> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the > taglist is all XHTML, which then causes markup errors.
So then do you work in XHTML, since it gets parsed as HTML anyways.
-- Fedora 9 : sulphur is good for the skin ( www.pembo13.com )
On Sat, Dec 27, 2008 at 10:47 AM, Marcelo Andrade <mfandr...@gmail.com> wrote: > On Sat, Dec 27, 2008 at 12:43 PM, Bernardo Vieira > <bvieira.li...@gmail.com> wrote:
>> gearvOsh wrote: >>> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the >>> taglist is all XHTML, which then causes markup errors.
>> gearvOsh, >> It shouldn't be too much of hassle to create a html4 helper based on >> the existing html helper. If you create your helper extending the >> existing html helper, basically all you'd have to do is copy/paste the >> tags array (lines 45-98 in 1.2 final) into your newly created class and >> change as necessary.
> As a suggestion for the developers, maybe a better > approach was to have some flag in the config that > tells the doctype compliance mode (strict, transition > for html 4.01 and xhtml 1.0).
That's going to be an arbitrary performance hit. I recently saw some not too CakePHP friendly benchmarks. I don't think that would help.
-- Fedora 9 : sulphur is good for the skin ( www.pembo13.com )
@gearvOsh - Thanks for pointing this out. I finally came to reading it
all, and I now personally find that this issue is to be seen as a
weakness of the CakePHP framework. I sadly do not possess the
knowledge at the moment to think up a good performance friendly simple
solution to solve the problem, but the generation of not valid code
can not be seen as positive!
On Dec 27, 11:50 pm, gearvOsh <mileswjohn...@gmail.com> wrote:
Just one question, because the thread opener has a point (XHTML and
HTML4 both have their benefits as HTML5 will probably have but XHTML2
seems not going to have):
Is there a CakePHP global way to define output type (XHTML 1.0, 1.1
HTML 4, all 3 strict, transitional, frameset) - if not, it is just
missing. It is no question of discussion. Many sites are serfed as
HTML and HTML 4 is a great option for those sites. CakePHP should
respect the requirement and a configuration parameter should be added
to core.php if it does not exist.
FormHelper for instances (but webroot/index.php as well and <link>
elements by css/js importers) should respect the settings.
It is not an option to run Tidy afterwards. That's the dirty way of
doing it.
> Honestly I really dislike the "xhtml" type of tags in CakePHP. There
> are no reasons for that, I think it would be a better idea to make it
> html 4 strict.
I think Adams answer is the only sane one here, that looks to be the
official way to change tag definitions after the app/config/tags.php
was deprecated almost 2 years ago ( https://trac.cakephp.org/ticket/2081 )... No need to override html helper, no need to pass everything
through htmltidy.
For those who need to scratch their HTML vs XHTML itch, follow the
code...
then, maybe using http://api.cakephp.org/html_8php-source.html#l00183 as a starting point, write something that would switch on the possible
doctypes and override the tags that might be throwing validation
errors for html4, write some test cases to prove correctness and
submit it as an enhancement to https://trac.cakephp.org/. No, it's
not built in, no, it's not broken, it just doesn't do exactly what you
want. Go go open source!
- R
On Dec 28, 6:46 pm, Adam Royle <a...@sleekgeek.com.au> wrote:
but first I have to have a working CakePHP application that actually
get's used. If that is the case I will aim for HTML 4 STRICT (and
later on HTML 5 STRICT or LOOSE let's see) and having website/
application quality in mind I will for sure be remembered on this
thread by the w3c validator =).