Well, it's not a bug per-se, perhaps an oversight?

Anyway, there's a spot of code in FormHelper::input() that maps field
type to input type; if the type is not in the map array then it uses
the default, which is a textarea. The current mapping is:

$map = array(
  'string'      => 'text',              'datetime'      => 'datetime',
  'boolean'     => 'checkbox',  'timestamp' => 'datetime',
  'text'                => 'textarea',  'time'          => 'time',
  'date'                => 'date'
);

As you can see, no numeric types are present, so they all default to
textarea. This doesn't look very easy to override, since it's in the
middle of a lot of other code - so it's either hack the core (not
good), replace the form helper (messy and prone to upgrade issues) or
set the type parameter when calling $form->input().

If this $map array was made a class variable, it could be overridden
in AppHelper. Perhaps you should submit an enhancement ticket for
this?

On Jan 23, 10:03 am, ProFire <[EMAIL PROTECTED]> wrote:
> Hi CakePHP Team,
>
> I'm a very satisfied Baker here. I've been using CakePHP for 2 months
> already and I really enjoy it. Compared to my previous experience with
> Spaghetti Framework, MVC Framework really rocks.
>
> I just have a little question to the CakePHP Team regarding the
> FormHelper. I'm not sure if this is a bug or not.
>
> Whenever I use the FormHelper in 1.2.X.X, it will auto-magically
> assign the appropriate INPUT for me according to my database field
> type. For example, DATE field will generate a DATE input for me. A
> VARCHAR field will generate a TEXT input for me.
>
> Now, the question is, why does FLOAT field generate TEXTAREA input?
>
> NOTE: Not that I don't know how to fix this, but I'm only wondering,
> could this be a bug? I know I can fix this with array("type" =>
> "text").
>
> I have a field with FLOAT type and it generates TEXTAREA auto-
> magically for me. Maybe we need harry potter to fix this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to