I have solved it With the help of @Hiren. he gives me a lead to use of eva/Model.
here what i did.
Created file Vendor\Module\Block\Options.php
<?php
namespace Vendor\Module\Block;
use Magento\Framework\View\Element\Template;
class Options extends \Magento\Contact\Block\ContactForm
{
protected $eavAttributeFactory;
protected $attributeOptionManagement;
public function __construct(
\Magento\Eav\Model\Entity\AttributeFactory $eavAttributeFactory,
\Magento\Eav\Api\AttributeOptionManagementInterface $attributeOptionManagement,
\Magento\Framework\View\Element\Template\Context $context
) {
parent::__construct($context);
$this->eavAttributeFactory = $eavAttributeFactory;
$this->attributeOptionManagement = $attributeOptionManagement;
}
public function getDropdown(){
$magentoAttributeOptions = $this->attributeOptionManagement->getItems(
'catalog_product','platform');
return $magentoAttributeOptions;
}
}
phtml file
<?php
$dropdown = $block->getDropdown();
?>
<select id="select_platform">
<option value="0">Please Select Platform</option>
<?php
foreach ($dropdown as $option):
$value = $option["value"];
$label = $option["label"];
echo "<option value='$value'>$label</option>";
endforeach;
?>