I have a list of ids which are fetched using Doctrine from database and which I need to display as hyperlinks on edit form.
I am trying to use ArrayField like this:
yield ArrayField::new('links')
->setFormTypeOption('allow_add', false)
->setFormTypeOption('allow_delete', false)
->setFormTypeOption('entry_type', UrlType:class)
->onlyOnForms();
But items are still displayed as <input type='text' ...>.
How can I change it to <a href='...'>?
UrlTypewill just render an input and prepend the http://, i think in your case you should create a customFormTypewith a form theme that renders as a link and add a listener on the form to change theentry_typein case of edit.EDIT:
1 - Create a custom FormType:
2 - create the form theme
3 - Configure it in twig
4 - configure it in easyadmin config