Magento 2 Tips : How to get client ip

Posted . 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
vasan
Posted by vasan to vasan's deck (2017-10-11 06:06)