[...]/cake/libs/view/helpers/html.php
Look for the function dateTimeOptionTag(), and specifically this piece of code:switch($dateFormat) {
case 'DMY': // so uses the new selex
$opt = $this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty) . '-' .
$this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty);
break;
case 'MDY':
$opt = $this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' .
$this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty);
break;
case 'YMD':
$opt = $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty) . '-' .
$this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' .
$this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty);
break;
case 'Y':
$opt = $this->yearOptionTag($tagName, null, null, null, $selected, $selectYearAttr, $optionAttr, $showEmpty);
break;
case 'NONE':
default:
$opt = '';
break;
}
In the above code you can change the starting year by replacing the third parameters of yearOptionTag() calls with a number you wish (instead of leaving it being null). This is easy, but implicates a bigger problem. Since you need to modify the framework itself, you cannot store CakePHP in and include from a single folder, but you have to copy the changed source to your actual project folder (and every project folder that need custom starting year). Something must be done about this in future versions of CakePHP. Otherwise it is a nifty framework to work with.
Utolsó kommentek