How to Create Referer URL in Magento 2
How about we start with the subject of conversation in regards to Magento 2 create Referrer Url.
Creatting Referrer Url on the off chance that Magento is extremely basic.
You can get this Referrer Url in regulator, Phtml.
Additionally, you can likewise get in Observer.
You need to simply utilize a strategy or a capacity called getRefererUrl() work or getRedirectUrl() work.
Furthermore, this above work you can get by utilizing connection point called Redirect Interface Object.
The way of this connection point which is utilized for bringing the Referrer URL is given underneath.
Way is Magento\Framework\App\Response\RedirectInterface.
In the event of PHP you can utilize straightforward code which given beneath to get reference url.
Yet, in the event of Magento, the most ideal way is to simply call the connection point in __construct() capacity and bring the referrer URL.
The following is code bit to reference Url.
In work, then you can call beneath line to get referrer Url.
Utilize the underneath code for it.
Magento 2 Create Referrer Url in Controller
It is easy to Create referer url in regulator.
To accomplish this you need to utilize the RedirectInterface.
You can allude the above code which is utilized in the build work.
Check with the beneath code get the referrer url in your execute strategy like this.
Comments
Post a Comment