2

In Magento 2.1.4, I created custom template in backend.

Company/Module/Block/Adminhtml/Edit/Custom has template Company_Module::html/custom.phtml.

custom.phtml code:

<div class="sample">
    ..........
</div>

Now I want to create a custom_ui.xml and set this into block. How to made it?

0

I don't think you are able to implement a ui component directly inside a .phtml file.

Implementing a ui-component to a page, is done by adding the ui-component to a layout xml file like:

<uiComponent name="..."/>

so if you just want to try to add some surrounding tag around your ui component, you maybe can try using a container layout handle around it.

Or by adding the ui-component to a child block of your current block and render the child block inside your template.

(Well meanwhile im working with 2.3.x, but i know this also works on 2.2.x ... i actually do not know how things were back at 2.1.x)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.