I want to share one field from Module A to Module B,
I am trying, (Module B)
$storeid = 'https://mybusiness.googleapis.com/v4/accounts/123456789/locations?filter=storeCode="<?php echo $this->getLayout()->createBlock("Zero\Storelocator\Block\Neareststore")->setTemplate("Zero_Storelocator::google_reviews.phtml")->toHtml(); ?>"'; $url = 'https://mybusiness.googleapis.com/v4/accounts/'.$accountId.'/locations/'.$storeid.'/reviews';
Logic: I want to get location id based on the store code, store code i am getting from Module A pass to Module B in URL 1 and get location ID using API and pass that location Id to second url
The first step, How to pass my Module A phtml file value to Module B php file,
Any best practice pls suggest?
Hi @Aveeva ,
Can you try below mentioned way to send data to block file from phtml file
You can also pass variables or parameters while calling the block from phtml file
1 | {{block class="Chapagain\HelloWorld\Block\HelloWorld" name="your_block_name" title="My Title" count="10" }} |
And in the block file you can get the values like