That option exist because that's what you'd use in a Helper, not in
the view (ctp) files.
It's a lot clearer and faster to just write <div> isn't it?
Use $this->Html->div() in your helper, instead of echo '<div>' (which
is horrible) IMO. :)
Each to his own, I guess, but I prefer to write static layout in HTML.

On Apr 23, 7:09 am, Jeremy Burns <jeremybu...@me.com> wrote:
> It begs the question "why does the $this->Html->div() option exist?" if it is 
> such a bad idea? And $this->Html->para(), and $this->Html->tag() and most of 
> the rest of the Html helper.
>
> I have taken the decision to standardise on using it throughout. I write each 
> page within <?php ?> tags and don't flip out to html unless I really have to 
> (and that is very rare). It makes my development path quicker, makes cleaner 
> code and it just works. I haven't seen any noticeable performance hit on my 
> pages, especially when they are cached correctly.
>
> Jeremy Burns
> jeremybu...@me.com
>
> On 23 Apr 2010, at 01:22, Ed Propsner wrote:
>
>
>
>
>
> > There was never any doubt that I would ultimately take a hit somewhere ... 
> > how much of one was really the question. I agree that in a sense you are 
> > adding an extra step but that's not entirely accurate either. I would think 
> > to avoid that "extra step" the page would need to be straight html and 
> > that's it. Your first php tag adds the extra step regardless of what the 
> > output is. So now I would think that it would hold true for the flip side 
> > of the coin as well ... think of it as "saving" an extra step. If you know 
> > part of the page is going to have to be processed through the server anyhow 
> > why not just start with PHP and stick with it throughout the page instead 
> > of jumping back and forth from PHP to HTML?
>
> > Yes, I totally agree that straight PHP requires a bit more overhead but I'm 
> > still on the fence as far as efficiency goes.
>
> > - Ed
>
> > On Thu, Apr 22, 2010 at 8:02 PM, Jamie <jamie....@gmail.com> wrote:
> > I agree with Miles that you should just use static HTML wherever
> > possible. It's just plain faster. If you use PHP to generate your
> > HTML, then you're adding an extra step to the process: instead of just
> > serving up plain HTML, the PHP parser needs to read the code,
> > interpret it, figure out what to do with it, and then output the
> > results. Not terribly efficient, especially if all you want is
> > "<div>".
>
> > Like you just said, your file size nearly tripled. You can generate an
> > entire website with CakePHP's helpers, sure, but you'll sure take a
> > hit in the efficiency department.
>
> > - Jamie
>
> > On Apr 22, 4:01 pm, Ed Propsner <crotchf...@gmail.com> wrote:
> > > Yep, the entire page is full of 'em ... 8-). I was just goofing around 
> > > with
> > > it ... I wanted to see if the page could really be coded in nothing but 
> > > cake
> > > tags. In the end it turned out to be quite the project to code the entire
> > > layout that way (the file size nearly tripled). Why is it that you would
> > > suggest using all static divs? I'm contemplating putting it back the way
> > > that it was but I'm really not seeing the difference at this point.
>
> > > On Thu, Apr 22, 2010 at 2:05 PM, Miles J <mileswjohn...@gmail.com> wrote:
> > > > Wait, so your saying you used the HTMLHelper div() method to build
> > > > everything? Should just stick with static divs.
>
> > > > On Apr 22, 2:34 am, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> > > > > I think its a question of clarity and ease to create maintain views
>
> > > > > - S
>
> > > > > On 22 April 2010 09:47, Ed Propsner <crotchf...@gmail.com> wrote:
>
> > > > > > I'm with ya' on  consistency and jumping in and out of php. The
> > > > document
> > > > > > seems to have a better flow and feel to it now that's it more 
> > > > > > uniform.
> > > > If
> > > > > > anything else it was good practice for someone new to Cake :)
>
> > > > > > - Ed
>
> > > > > > On Thu, Apr 22, 2010 at 4:35 AM, Jeremy Burns <jeremybu...@me.com>
> > > > wrote:
>
> > > > > >> I have asked myself this question too and posed a similar point (is
> > > > using
> > > > > >> Cake tags ultimately slower than straightforward html? to which the
> > > > answer
> > > > > >> was 'probably, yes'). However, I have adopted the Cake tag route
> > > > throughout
> > > > > >> because (i) it provide consistency, (ii) it means I am not jumping 
> > > > > >> in
> > > > and
> > > > > >> out of PHP and (iii) it just feels 'safer' - pass in the right 
> > > > > >> options
> > > > and
> > > > > >> out pops the right html. I guess it's a matter of choice?
>
> > > > > >> Jeremy Burns
> > > > > >> jeremybu...@me.com <jeremybu...@mac.com>
>
> > > > > >> On 22 Apr 2010, at 09:31, Ed Propsner wrote:
>
> > > > > >> Out of curiosity and perhaps a little boredom I re-scripted my
> > > > default.ctp
> > > > > >> to completely follow Cake conventions.
> > > > > >> From the doctype to the closing html tag there is not a single
> > > > > >> conventional html tag on the page.
> > > > > >> 95% of my layout is structured with divs in lieu of tables so 
> > > > > >> there is
> > > > > >> quite a bit on the page as far as tags go.
>
> > > > > >> My question is this ... how much is too much? With the increase in
> > > > file
> > > > > >> size the pages will ultimately render slower,
> > > > > >> or is this of little significance assuming how much time is really
> > > > being
> > > > > >> lost?
>
> > > > > >> I don't really see any immediate advantages besides consistency 
> > > > > >> which
> > > > in
> > > > > >> itself works for me because I never cared much
> > > > > >> for jumping in and out of php anyhow.
>
> > > > > >> - Ed
>
> > > > > >> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > > > >> others with their CakePHP related questions.
>
> > > > > >> You received this message because you are subscribed to the Google
> > > > Groups
> > > > > >> "CakePHP" group.
> > > > > >> To post to this group, send email to cake-php@googlegroups.com
> > > > > >> To unsubscribe from this group, send email to
> > > > > >> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c
> > > > > >>  om>For more options, visit this group
> > > > > >> athttp://groups.google.com/group/cake-php?hl=en
>
> > > > > >>  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > > > >> others with their CakePHP related questions.
>
> > > > > >> You received this message because you are subscribed to the Google
> > > > Groups
> > > > > >> "CakePHP" group.
> > > > > >> To post to this group, send email to cake-php@googlegroups.com
> > > > > >> To unsubscribe from this group, send email to
> > > > > >> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c
> > > > > >>  om>
> > > > <cake-php%2bunsubscr...@googlegroups.com<cake-php%252bunsubscr...@googlegro
> > > >  ups.com>>For
> > > > more options, visit this group at
> > > > > >>http://groups.google.com/group/cake-php?hl=en
>
> > > > > >  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > > > > others with their CakePHP related questions.
>
> > > > > > You received this message because you are subscribed to the Google
> > > > Groups
> > > > > > "CakePHP" group.
> > > > > > To post to this group, send email to cake-php@googlegroups.com
> > > > > > To unsubscribe from this group, send email to
> > > > > > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c
> > > > > >  om>
> > > > <cake-php%2bunsubscr...@googlegroups.com<cake-php%252bunsubscr...@googlegro
> > > >  ups.com>>For
> > > > more options, visit this group at
> > > > > >http://groups.google.com/group/cake-php?hl=en
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers
> > > > with their CakePHP related questions.
>
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups
> > > > "CakePHP" group.
> > > > > To post to this group, send email to cake-php@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c
> > > > >  om>For more options, visit this group athttp://
> > > > groups.google.com/group/cake-php?hl=en
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > > with their CakePHP related questions.
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c
> > > >  om>For more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this...
>
> read more »

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to