3

I have below code in phtml 1:

<?php $itemid = $item->getItemId() ?>
<a href="<?php echo $this->getUrl('history/customer/detail', 
            ['item_id' =>$itemid]); ?>">Product Detail
</a>

How can I get variable $itemid with using function $_GET in phtml 2.

Can anyone show me?

Thanks.

1 Answer 1

7

You can achieve this

$this->getRequest()->getParams(); 

will get you the all parameters

If you want to get specific param

$this->getRequest()->getParam('something');

In your case, It should be like this

$this->getRequest()->getParam('item_id');

I hope this will help

0

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.