dob.phtml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Customer\Block\Widget\Dob $block */
  8. /*
  9. <?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
  10. ->setDate($block->getCustomer()->getDob())
  11. ->toHtml() ?>
  12. For checkout/onepage/billing.phtml:
  13. <?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
  14. ->setDate($block->getCustomer()->getDob())
  15. ->setFieldIdFormat('billing:%s')
  16. ->setFieldNameFormat('billing[%s]')
  17. ->toHtml() ?>
  18. NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css. Alternatively we could calculate widths
  19. automatically using block input parameters.
  20. */
  21. $fieldCssClass = 'field date field-' . $block->getHtmlId();
  22. $fieldCssClass .= $block->isRequired() ? ' required' : '';
  23. ?>
  24. <div class="<?= $block->escapeHtmlAttr($fieldCssClass) ?>">
  25. <label class="label" for="<?= $block->escapeHtmlAttr($block->getHtmlId()) ?>"><span><?= $block->escapeHtml($block->getStoreLabel('dob')) ?></span></label>
  26. <div class="control customer-dob">
  27. <?= $block->getFieldHtml() ?>
  28. <?php if ($_message = $block->getAdditionalDescription()) : ?>
  29. <div class="note"><?= $block->escapeHtml($_message) ?></div>
  30. <?php endif; ?>
  31. </div>
  32. </div>