How to use function $_GET in Magento 2?How to get product category id on product detail page Magento 2TypeError: element.prop is not a function - Magento 2How to get Tier Price of product magento2?How to get order details in a Magento2 custom controller action?Magento 2: call helper function in ui component formLoad custom product detail page instead of default in Magento 2How to echo or vardump product detail on cart pageHow to get the order item id in Magento 2 (not the order ID)?How get Image Url by product_id or other wayHow to display product by using order Item_Id in Magento 2?

Other than a swing wing, what types of variable geometry have flown?

Why no ";" after "do" in sh loops?

How may I concisely assign different values to a variable, depending on another variable?

Terence Tao–type books in other fields?

What is the lowest-speed bogey a jet fighter can intercept/escort?

kids pooling money for Lego League and taxes

How can I tell if there was a power cut while I was out?

Is it legal for private citizens to "impound" e-scooters?

Can I go to the UK from the Schengen on train?

Are there any examples of technologies have been lost over time?

expansion with *.txt in the shell doesn't work if no .txt file exists

What does "a good player" mean in the movie Training day?

Where to place an artificial gland in the human body?

Replacing tongue and groove floorboards: but can't find a match

How do I run a game when my PCs have different approaches to combat?

Convert a string like 4h53m12s to a total number of seconds in JavaScript

"I you already know": is this proper English?

Why isn't there a serious attempt at creating a third mass-appeal party in the US?

Commercial jet accompanied by small plane near Seattle

Character is called by their first initial. How do I write it?

Why did Saturn V not head straight to the moon?

How important is a good quality camera for good photography?

Why was Sauron not trying to find the Ring, and instead of preparing for war?

Explanation for a joke about a three-legged dog that walks into a bar



How to use function $_GET in Magento 2?


How to get product category id on product detail page Magento 2TypeError: element.prop is not a function - Magento 2How to get Tier Price of product magento2?How to get order details in a Magento2 custom controller action?Magento 2: call helper function in ui component formLoad custom product detail page instead of default in Magento 2How to echo or vardump product detail on cart pageHow to get the order item id in Magento 2 (not the order ID)?How get Image Url by product_id or other wayHow to display product by using order Item_Id in Magento 2?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















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.










share|improve this question






























    2















    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.










    share|improve this question


























      2












      2








      2


      0






      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.










      share|improve this question
















      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.







      magento2 get






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 16 at 16:38









      Taschert

      19510 bronze badges




      19510 bronze badges










      asked Jul 16 at 6:25









      Michael TaoMichael Tao

      588 bronze badges




      588 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          6














          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






          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282185%2fhow-to-use-function-get-in-magento-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6














            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






            share|improve this answer





























              6














              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






              share|improve this answer



























                6












                6








                6







                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






                share|improve this answer















                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







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 16 at 6:43

























                answered Jul 16 at 6:29









                Muhammad HashamMuhammad Hasham

                5,72610 gold badges31 silver badges80 bronze badges




                5,72610 gold badges31 silver badges80 bronze badges



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282185%2fhow-to-use-function-get-in-magento-2%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림