Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodrigowebjump/bdf3c2033f23551c269f to your computer and use it in GitHub Desktop.
Save rodrigowebjump/bdf3c2033f23551c269f to your computer and use it in GitHub Desktop.
Exibir campo de data de nascimento e sexo

Para página de cadastro

<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
<li class="fields">
	<?php if ($_dob->isEnabled()): ?>
	<div class="field"><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></div>
	<?php endif ?>
	<?php if ($_gender->isEnabled()): ?>
	<div class="field"><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></div>
	<?php endif ?>
</li>

Para página de edição

<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
<li class="fields">
	<?php if ($_dob->isEnabled()): ?>
	<div class="field"><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></div>
	<?php endif ?>
	<?php if ($_gender->isEnabled()): ?>
	<div class="field"><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></div>
	<?php endif ?>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment