Well, I didn't get a single reply to this. Awesome.

Turns out you have to pass in '' NOT null as the documentation erroneously
says.

*sigh*

Maybe someone can update the docs to reflect the real deal, or else fix the
functions so that they work as designed (with null).

> -----Original Message-----
> From: [email protected]
[mailto:[EMAIL PROTECTED]
> On Behalf Of Daevid Vincent
> Sent: Thursday, May 08, 2008 4:57 PM
> To: [email protected]
> Subject: [symfony-users] select_month_tag() not respecting NULL default
> 
> 
> I am new to symfony. In some page that already existed, I've been tasked
to
> fix a bug. There is this block of code:
> 
> <?php echo select_month_tag('bmonth', null, 'include_custom='.__('Month'),
> array('style'=>'margin-left: 10px;')) ?> -
> <?php echo select_day_tag('bday', null, 'include_custom='.__('Day')) ?> -
> <?php echo select_year_tag('byear', null, array('year_start'=>'1900',
> 'year_end'=>'2008', 'include_custom'=>__('Year'))) ?>
> 
> But what happens is that when we load the page, the select boxes are all
set
> to the current date values. If I put "1" instead of "null", they obviously
> go to January 1st. I want them to each be defaulting to the top option of
> "Month", "Day" and "Year" so the user must choose the proper values.
> 
> What gives?
> 
>
http://www.symfony-project.org/api/1_0/DateFormHelper#method_select_month_ta
g
> 
> By default, the $value parameter is set to today&apos;s month. To override
> this, simply pass an integer (1 - 12) to the $value parameter. You can
also
> set the $value parameter to null which will disable the $value, however
this
> will only be useful if you pass &apos;include_blank&apos; or
> &apos;include_custom&apos; to the $options parameter.
> 
> (also, what's with the &apos; in the docs? Can't someone fix those? Why
even
> use that at all - just use ' and avoid this messy output)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to