Create Drop Down Date list.
App::Html()->dateDDTag(Name,[Year Range],[Default Value],[Options]);
Parameter |
Description |
---|---|
Name |
Name of the Input element |
Year Range |
Define Year range in Array |
Default Value |
Default selected value |
Options |
HTML Attributes |
See bellow example:
echo App::Html()
->dateDDTag(
"data[Signup][joindate]",
array("Start"=>"2010","End"=>"2020"),
"2015-05-01",
array("class"=>"app_input")
);
/*
Return value
<select name="data[Signup][date][day]" >
<option value=""></option>
<option selected="selected" value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
------------------------------
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="data[Signup][date][month]" >
<option value=""></option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option selected="selected" value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="data[Signup][date][year]">
<option value=""></option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option selected="selected" value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
</select>
*/