I want to display select input field which contain customer gender options in my custom layout block in magento 2 ? how can i do this?
/Vendor/Module/Block/Customer.php
public function getCustomerGenderOptions(){
//how?
}
/Vendor/Module/view/frontend/templates/customer.phtml
<select name="gender">
<?php foreach ($block->getCustomerGenderOptions() as $genderOption): ?>
<option value="<?= $genderOption['value'] ?>"><?= $genderOption['label'] ?></option>
<?php endforeach; ?>
</select>