cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to inject data in ListProduct block

Not able to inject data in ListProduct block

Di xml

 

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\ListProduct">
        <arguments>
            <argument name="data" xsi:type="array">
                  <item name="0" xsi:type="string">anystring</item>
                 <item name="1" xsi:type="string">xyz</item>
                <item name="2" xsi:type="string">abs</item>
            </argument>
        </arguments>
    </type>
</config>

when on list.phtml i print with 

 

<?php var_dump($block->getData());exit('to'); ?>

I am not getting my injected data.