i'm using like this
for start tag
$this->Html->useTag('tagstart', 'div', array(html options here));
for end tag
$this->Html->useTag('tagend', 'div');
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/2/21 Perry <[email protected]>
> thanks for the reply, I have many elements to be wrapped, and I'm using
> the HtmlHelper to generate these nested elements too, so I cant' pass these
> elements as the second parameter
>
> maybe I should write the layout directly
>
>
> On Tue, Feb 21, 2012 at 2:36 PM, Greg Skerman <[email protected]> wrote:
>
>> 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
>>
>
>
>
> --
> 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