What type of redirect is this?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}






up vote
3
down vote

favorite












While i'm studying a line of code in magento vendor file I found this code



$resultRedirect->setPath('*/*/');


What does this '*/*/' means and where does this redirects.
I hope will get clarification.










share|improve this question
























  • On which controller file you get this?
    – Sukumar Gorai
    Nov 26 at 11:34

















up vote
3
down vote

favorite












While i'm studying a line of code in magento vendor file I found this code



$resultRedirect->setPath('*/*/');


What does this '*/*/' means and where does this redirects.
I hope will get clarification.










share|improve this question
























  • On which controller file you get this?
    – Sukumar Gorai
    Nov 26 at 11:34













up vote
3
down vote

favorite









up vote
3
down vote

favorite











While i'm studying a line of code in magento vendor file I found this code



$resultRedirect->setPath('*/*/');


What does this '*/*/' means and where does this redirects.
I hope will get clarification.










share|improve this question















While i'm studying a line of code in magento vendor file I found this code



$resultRedirect->setPath('*/*/');


What does this '*/*/' means and where does this redirects.
I hope will get clarification.







magento2 magento-2.1 redirect php-7 redirect-url






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 5:41









Nagaraju Kasa

2,41011237




2,41011237










asked Nov 26 at 11:31









Ramesh KR

18610




18610












  • On which controller file you get this?
    – Sukumar Gorai
    Nov 26 at 11:34


















  • On which controller file you get this?
    – Sukumar Gorai
    Nov 26 at 11:34
















On which controller file you get this?
– Sukumar Gorai
Nov 26 at 11:34




On which controller file you get this?
– Sukumar Gorai
Nov 26 at 11:34










3 Answers
3






active

oldest

votes

















up vote
6
down vote













If you need to know detail about the following code then read the following:



$resultRedirect->setPath('*/*/');


First * means current route and second * means current controller. Let me explain it in detail with example.



Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/index. Index action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/');.



Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/test'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/test. Test action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/test');.



Summary: First * for route, second * for controller and third for action.






share|improve this answer




























    up vote
    4
    down vote













    It is used to redirect current route, current controller's index action.



    Let say if you are currently browsing




    checkout/index/customaction




    if you are using this code in custom action controller, then it will redirect you to checkout/index/index
    So in this case




    checkout/index/index = '*/*/' OR '*/*/Index' (both are same);




    here




    First * denotes current route, in our example its checkout



    Second * denotes controller, in our example its Index



    Third * denotes action (if available otherwise Index by default)




    if you use




    '*/*/test'




    Then in our example it will redirect you to checkout/index/test.




    '*/*/*' means current action




    Also we can say that '*/*' will redirect you to the current module's index controller



    I hope you got idea on it.






    share|improve this answer






























      up vote
      2
      down vote













       $resultRedirect->setPath('*/*/');


      This will redirect you to the current module's index controller. For example you are on customer/account/create controller then If I write this line of code in controller it'll take you to customer/account/index controller.






      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',
        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%2f251328%2fwhat-type-of-redirect-is-this%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        6
        down vote













        If you need to know detail about the following code then read the following:



        $resultRedirect->setPath('*/*/');


        First * means current route and second * means current controller. Let me explain it in detail with example.



        Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/index. Index action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/');.



        Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/test'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/test. Test action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/test');.



        Summary: First * for route, second * for controller and third for action.






        share|improve this answer

























          up vote
          6
          down vote













          If you need to know detail about the following code then read the following:



          $resultRedirect->setPath('*/*/');


          First * means current route and second * means current controller. Let me explain it in detail with example.



          Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/index. Index action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/');.



          Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/test'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/test. Test action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/test');.



          Summary: First * for route, second * for controller and third for action.






          share|improve this answer























            up vote
            6
            down vote










            up vote
            6
            down vote









            If you need to know detail about the following code then read the following:



            $resultRedirect->setPath('*/*/');


            First * means current route and second * means current controller. Let me explain it in detail with example.



            Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/index. Index action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/');.



            Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/test'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/test. Test action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/test');.



            Summary: First * for route, second * for controller and third for action.






            share|improve this answer












            If you need to know detail about the following code then read the following:



            $resultRedirect->setPath('*/*/');


            First * means current route and second * means current controller. Let me explain it in detail with example.



            Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/index. Index action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/');.



            Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $resultRedirect->setPath('*/*/test'); then it will redirect you to current route and current controller like http://example.com/someroute/somecontroller/test. Test action is here because if you have not mentioned any action $resultRedirect->setPath('*/*/test');.



            Summary: First * for route, second * for controller and third for action.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 26 at 11:46









            Sukumar Gorai

            5,7963527




            5,7963527
























                up vote
                4
                down vote













                It is used to redirect current route, current controller's index action.



                Let say if you are currently browsing




                checkout/index/customaction




                if you are using this code in custom action controller, then it will redirect you to checkout/index/index
                So in this case




                checkout/index/index = '*/*/' OR '*/*/Index' (both are same);




                here




                First * denotes current route, in our example its checkout



                Second * denotes controller, in our example its Index



                Third * denotes action (if available otherwise Index by default)




                if you use




                '*/*/test'




                Then in our example it will redirect you to checkout/index/test.




                '*/*/*' means current action




                Also we can say that '*/*' will redirect you to the current module's index controller



                I hope you got idea on it.






                share|improve this answer



























                  up vote
                  4
                  down vote













                  It is used to redirect current route, current controller's index action.



                  Let say if you are currently browsing




                  checkout/index/customaction




                  if you are using this code in custom action controller, then it will redirect you to checkout/index/index
                  So in this case




                  checkout/index/index = '*/*/' OR '*/*/Index' (both are same);




                  here




                  First * denotes current route, in our example its checkout



                  Second * denotes controller, in our example its Index



                  Third * denotes action (if available otherwise Index by default)




                  if you use




                  '*/*/test'




                  Then in our example it will redirect you to checkout/index/test.




                  '*/*/*' means current action




                  Also we can say that '*/*' will redirect you to the current module's index controller



                  I hope you got idea on it.






                  share|improve this answer

























                    up vote
                    4
                    down vote










                    up vote
                    4
                    down vote









                    It is used to redirect current route, current controller's index action.



                    Let say if you are currently browsing




                    checkout/index/customaction




                    if you are using this code in custom action controller, then it will redirect you to checkout/index/index
                    So in this case




                    checkout/index/index = '*/*/' OR '*/*/Index' (both are same);




                    here




                    First * denotes current route, in our example its checkout



                    Second * denotes controller, in our example its Index



                    Third * denotes action (if available otherwise Index by default)




                    if you use




                    '*/*/test'




                    Then in our example it will redirect you to checkout/index/test.




                    '*/*/*' means current action




                    Also we can say that '*/*' will redirect you to the current module's index controller



                    I hope you got idea on it.






                    share|improve this answer














                    It is used to redirect current route, current controller's index action.



                    Let say if you are currently browsing




                    checkout/index/customaction




                    if you are using this code in custom action controller, then it will redirect you to checkout/index/index
                    So in this case




                    checkout/index/index = '*/*/' OR '*/*/Index' (both are same);




                    here




                    First * denotes current route, in our example its checkout



                    Second * denotes controller, in our example its Index



                    Third * denotes action (if available otherwise Index by default)




                    if you use




                    '*/*/test'




                    Then in our example it will redirect you to checkout/index/test.




                    '*/*/*' means current action




                    Also we can say that '*/*' will redirect you to the current module's index controller



                    I hope you got idea on it.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 27 at 5:03

























                    answered Nov 26 at 11:36









                    Himmat Paliwal

                    1,018417




                    1,018417






















                        up vote
                        2
                        down vote













                         $resultRedirect->setPath('*/*/');


                        This will redirect you to the current module's index controller. For example you are on customer/account/create controller then If I write this line of code in controller it'll take you to customer/account/index controller.






                        share|improve this answer

























                          up vote
                          2
                          down vote













                           $resultRedirect->setPath('*/*/');


                          This will redirect you to the current module's index controller. For example you are on customer/account/create controller then If I write this line of code in controller it'll take you to customer/account/index controller.






                          share|improve this answer























                            up vote
                            2
                            down vote










                            up vote
                            2
                            down vote









                             $resultRedirect->setPath('*/*/');


                            This will redirect you to the current module's index controller. For example you are on customer/account/create controller then If I write this line of code in controller it'll take you to customer/account/index controller.






                            share|improve this answer












                             $resultRedirect->setPath('*/*/');


                            This will redirect you to the current module's index controller. For example you are on customer/account/create controller then If I write this line of code in controller it'll take you to customer/account/index controller.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 26 at 11:37









                            Ramkishan Suthar

                            1,8941932




                            1,8941932






























                                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.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • 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%2f251328%2fwhat-type-of-redirect-is-this%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

                                mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                                How to change which sound is reproduced for terminal bell?

                                Can I use Tabulator js library in my java Spring + Thymeleaf project?