Hi

I used the FormHelper $form->input() method to wrap a dateTime this
way:

echo $form->input('expire',array(
          'type'=>'datetime',
          'dateFormat' => 'DMY',
          'timeFormat' => '24',
          'selected' => null,
          'attributes' => array(),
          )
        );

I read in the dateTime options that the default behaviour is to show
an empty default value (as showEmpty = true is the default), so I
didn't pass anything because I want an empty value. By the way if I
call it this way I get a default value in it.

So I tried to call the input() this way:

echo $form->input('expire',array(
          'type'=>'datetime',
          'dateFormat' => 'DMY',
          'timeFormat' => '24',
          'selected' => null,
          'attributes' => array(),
          'showEmpty' => true
          )
        );

but the result was the same. Looking inside the input() method I found
that to get an empty default value you should set the "empty" option,
which is set to false per default. Finally calling it with...

echo $form->input('expire',array(
          'type'=>'datetime',
          'dateFormat' => 'DMY',
          'timeFormat' => '24',
          'selected' => null,
          'attributes' => array(),
          'empty' => true
          )
        );

... gives me the desired result. I think that the mapping between the
options in the input() method and the options in the dateTime() method
should be consistent to avoid people to look inside the code to
discover the correct mapping.

Regards

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to