Re: Possible bug in HtmlHelper ?

2010-10-06 Thread mark_story
Don't use the Html->tag method to make inputs.  It won't do it
correctly, as it wasn't intended for this.  Use the FormHelper, its
much better at building input tags.

-Mark

On Oct 4, 6:20 am, Adael  wrote:
> Hi all, in HtmlHelper::tag() (line 728) we found this code:
>
> if ($text === null) {
>         $tag = 'tagstart';
>
> } else {
>         $tag = 'tag';
> }
>
> So, if you do the call
>
>     echo $html->tag('input', 'name', 'value');
>
> It's output: name
> I except: 
>
> Other way:
>
>     echo $html->tag('input', 'name', array('value' => 'thevalue',
> class='miclass'));
>
> output: name
> excepted:  class='miclass'/>
>
> In documentation, you can find that HtmlHelper->tags has an array with
> preformatted tags (wich uses sprintf). That functionality doesn't
> works.
>
> i have no time to explain, but i think that addition can fix the
> problem:
>
> if ($text === null) {
>         $tag = 'tagstart';
>
> }elseif( array_key_exists($name, $this->tags) ){
>         $tag = $name;
> } else {
>         $tag = 'tag';
> }
>
> Thans to all, and excuse my bad english, i'm spanish.

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


Possible bug in HtmlHelper ?

2010-10-04 Thread Adael
Hi all, in HtmlHelper::tag() (line 728) we found this code:

if ($text === null) {
$tag = 'tagstart';
} else {
$tag = 'tag';
}

So, if you do the call

echo $html->tag('input', 'name', 'value');

It's output: name
I except: 

Other way:

echo $html->tag('input', 'name', array('value' => 'thevalue',
class='miclass'));

output: name
excepted: 

In documentation, you can find that HtmlHelper->tags has an array with
preformatted tags (wich uses sprintf). That functionality doesn't
works.

i have no time to explain, but i think that addition can fix the
problem:

if ($text === null) {
$tag = 'tagstart';
}elseif( array_key_exists($name, $this->tags) ){
$tag = $name;
} else {
$tag = 'tag';
}

Thans to all, and excuse my bad english, i'm spanish.

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