1

I want to use config function in XML file to render the phtml file same as below that we use in magento 1.x.x

<reference name="root">
    <action method="setTemplate" ifconfig="mymodule/general/enabled"><template>page/1column.phtml</template></action>
</reference>

How can I do it on magento2.

I have created my config function in helper and want to use these function to render the phtml, based on configuration setting.

1

1 Answer 1

2

We can use something like below in Magento2:

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="contact/contact/enabled" name="contact-us-link">

Let me know if its helpful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.