3

Anyone can explain to me what is the use of [_secure => true] in controller redirect path arguments in Magento 2.

1

Figured out it

Fundamentally it's a parameter which is set. The getting and setting of the parameter does nothing more than set or get the value.

https://github.com/magento/magento2/blob/2.3/lib/internal/Magento/Framework/Url.php#L406-L415

However other functionality looks at the value

https://github.com/magento/magento2/blob/2.3/lib/internal/Magento/Framework/Url.php#L307-L321

But in summary it's telling Magento to switch to the configured secure URL if it's configured.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.