Пример #1
0
 /**
  * Adds a sequence of years to a {@link I2CE_Template} object.
  * 
  * It takes two optional arguments to limit the years to use.  The initial year to start with is 1990 and it will end
  * with the current year.
  * @param I2CE_Template $template
  * @param string $selectId The id of the element in the page to add the selections to.
  * @param integer $start The year to start with
  * @param integer $end The year to end with.
  * @see I2CE_Template::setData()
  */
 public static function listYears($template, $selectId, $start = 1990, $end = 0)
 {
     if ($end == 0) {
         $now = getdate();
         $end = $now['year'];
     }
     for ($i = $start; $i <= $end; $i++) {
         $template->setData(array('text' => $i, 'value' => $i), $selectId, 'OPTION', $selectId);
     }
 }