Magento 2 Tips : How to get client ip

Posted Over 6 years ago. Visible to the public.

The client ip can be retrieved using

getClientIp()

method in

Magento\Framework\HTTP\PhpEnvironment\Request

class. This is very useful , when do the ip restriction in maintenance page development.

vasan
Last edit
Over 6 years ago
vasan
Posted by vasan to vasan's deck (2017-10-11 06:06)