2015-09-15 38 views
1

我工作的Magento 2.Magento的2 - 獲得scopeconfig值

但找不到佈局的xml文件得到scopeconfig值的解決方案。

在magento 1.x中,使用如下。

<block type="cms/block" ...> 
    <action method="..." ifconfig="config_path/config"></action> 
</block> 

在magento 2中,如何在佈局xml中使用「ifconfig」?

回答

1

與magento 1.x相同。

你可以像下面一樣使用。

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="catalog/seo/search_terms" name="search-term-popular-link"> 
+0

如何在phtml文件中使用它? – Dmitry

0

你可以像下面一樣使用。

<block class="Magento\Rss\Block\Feeds" ifconfig="rss/config/active" name="head_rss">