DayChoiceList.php 669 B

123456789101112131415161718192021222324
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Form\ChoiceList;
  11. class DayChoiceList extends PaddedChoiceList
  12. {
  13. public function __construct(array $days = array(), array $preferredChoices = array(), $emptyValue = '', $required = false)
  14. {
  15. if (count($days) === 0) {
  16. $days = range(1, 31);
  17. }
  18. parent::__construct($days, 2, '0', STR_PAD_LEFT, $preferredChoices, $emptyValue, $required);
  19. }
  20. }