I am working on reference block concept, in that I need to add new arguments and get the argument value on the .phmlt file.
in catalog_product_view.xml I've added the below line of code.
<referenceBlock name="product.info.addtocart">
<arguments>
<argument name="current_page" xsi:type="string">detail</argument>
<argument name="all_page" xsi:type="string">all</argument>
</arguments>
<!-- <action method="setData">
<name>current_page</name>
<value>detail</value>
<name>all_page</name>
<value>all</value>
</action> -->
<block class="Learn\Test\Block\Sample" name="sample.otherproducts" as="sample.products" after="-" template="catalog/product/view/sample.phtml" />
</referenceBlock>
Then in my sample.phtml file I am using the following lines for getting the value of the arguments
$this->getData('current_page');
$this->getCurrentPage();
But nothing is get the value of the current_page arugment, what is the exact procedure to bind the value on reference block layout and get it into the .phtml file
Kindly share your thoughts and ideas, thanks in advance for your support