I'm new in Magento 2 and I couldn't figure out what is the difference in doing a admin form module in PHP, calling a class and then using formFactory to create the form:
<referenceContainer name="content">
<block class="BVZ\Designer\Block\Adminhtml\Post\Edit" name="designer_post_edit"/>
</referenceContainer>
[...]
$form = $this->_formFactory->create(
[
'data' => [
'id' => 'edit_form',
'action' => $this->getData('action'),
'method' => 'post',
'enctype' => 'multipart/form-data'
]
]
or calling a Ui component and using a xml fieldset
<body>
<referenceContainer name="content">
<uiComponent name="stores_index_edit"/>
</referenceContainer>
</body>
[...]
<field name="store_id">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
<item name="dataType" xsi:type="string">text</item>
<item name="formElement" xsi:type="string">input</item>
<item name="source" xsi:type="string">store</item>
</item>
</argument>
</field>
Is it a method better than the other or it has different proposals?