I always find leaving the markup in its native language is beneficial,
except in cases where cake's pathing becomes an issue (image, anchors
etc)...

I'd go and write <div>foo</div> personally, but thats just me.

however, from the documentation:

HtmlHelper::div(*string $class*, *string $text*, *array $options*)
Parameters:

   - *$class* (*string*) – The classname for the div.
   - *$text* (*string*) – The content inside the div.
   - *$options* (*array*) – An array of *html
attributes*<http://book.cakephp.org/2.0/en/appendices/glossary.html#term-html-attributes>
   .

  Used for creating div-wrapped sections of markup. The first parameter
specifies a CSS class, and the second is used to supply the text to be
wrapped by div tags. If the last parameter has been set to true, $text will
be printed HTML-escaped.

If no text is specified, only an opening div tag is returned.:

<?phpecho $this->Html->div('error', 'Please enter your credit card number.');
// Output<div class="error">Please enter your credit card number.</div>

i.e. its going to wrap it up in a closing div for you....but you need to
pass a class to it as the first parameter... $this->Html->div('someClass',
'foo'); should do the trick.




On Tue, Feb 21, 2012 at 4:13 PM, Perry <[email protected]> wrote:

> Hi guys, I want to wrap some elements in a div, and I'm using
>
> $this->Html->div('foo')
>
>
> to generate the starting div tag, but I can't find a method to generate
> the closing tag
>
> how can I use the HtmlHelper to do this? I think write the '</div>'
>  directly is ugly...
>
> --
> Perry | 彭琪
> http://pengqi.me
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to