Friday, February 27, 2009

Re: Creating a liste a years

thanks, it's working now !

However, when i submit it, cake creates this array :

[class_year] => Array
(
[year] => 1997
)

How can I have simply

[class_year] => 1997

On Feb 26, 6:30 pm, mscdex <msc...@gmail.com> wrote:
> If you're just interested in year information and not days and months
> for example, then you can use a different Form Helper method:
>
> $form->year('class_year', 1900, 2000, $membre['Membre']
> ['class_year']);
>
> This will create a select box containing all the years from 1900 to
> 2000 with the selected year given by $membre['Membre']['class_year'].
> If you don't want the user to be able to select no year, then do:
>
> $form->year('class_year', 1900, 2000, $membre['Membre']['class_year'],
> array(), false);
>
> Cake manual page with brief info on this function here:http://book.cakephp.org/view/714/year
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: