I am trying to convert one of my cshtml files to phtml. In cshtml we can use html helper library DropDownListFor to create a dropdown and assign a model to get the values from,how do we do the same in magento2

I am attaching my cshtml file below

@model FIDO2FADemo.Models.FidoVerifyModel

@using (Html.BeginForm("VerifyFido", "New", FormMethod.Post, new { role = "form", id = "formFido" }))
    @Html.ValidationSummary(false, "", new { @class = "text-danger" })
    @Html.HiddenFor(model => Model.UserID)
    @Html.DropDownListFor(m => m.ID, Model.FidoDevicesSelect, new { htmlAttributes = new { @class = "form-control" } })


@section Scripts {


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.