I tried changing those, and it doesnt get passed 1973 and 2007.
Thanks, Vix
On Jul 11, 11:06 pm, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> 2008/7/12 Vixy <[EMAIL PROTECTED]>:
>
>
>
>
>
> > Hi, In the HTML Helper, I found this code:
> > function yearOptionTag($tagName, $value = null, $minYear = null,
> > $maxYear = null, $selected = null, $selectAttr = null, $optionAttr =
> > null, $showEmpty = true) {
> > if (empty($selected) && ($this->tagValue($tagName))) {
> > $selected = date('Y',
> > strtotime($this->tagValue($tagName)));
> > }
>
> > $yearValue = empty($selected) ? ($showEmpty ? NULL :
> > date('Y')) :
> > $selected;
> > $currentYear = date('Y');
> > $maxYear = is_null($maxYear) ? $currentYear + 11 : $maxYear
> > + 1;
> > $minYear = is_null($minYear) ? $currentYear - 60 : $minYear;
>
> > if ($minYear > $maxYear) {
> > $tmpYear = $minYear;
> > $minYear = $maxYear;
> > $maxYear = $tmpYear;
> > }
>
> > $minYear = $currentYear < $minYear ? $currentYear :
> > $minYear;
> > $maxYear = $currentYear > $maxYear ? $currentYear :
> > $maxYear;
>
> > for ($yearCounter = $minYear; $yearCounter < $maxYear;
> > $yearCounter+
> > +) {
> > $years[$yearCounter] = $yearCounter;
> > }
>
> > return $this->selectTag($tagName . "_year", $years,
> > $yearValue,
> > $selectAttr, $optionAttr, $showEmpty);
> > }
>
> > This out puts a drop down box for my signup form. The years that show
> > up are from 1948 - 2018. This is a signup form and if someone is
> > signning up, how can they have thier birthday in 2018? So how can I
> > change it to this range: 1980-1994?
>
> - As you have noticed in the code, you need to pass $minYear and $maxYear to
> method
>
> --
> Amit
>
> http://amitrb.wordpress.com/http://coppermine-gallery.net/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---