latte icon indicating copy to clipboard operation
latte copied to clipboard

ipv4/ipv6 address filters

Open Izolant opened this issue 1 year ago • 1 comments

Hello,

Is there a plan to add support for IP address filtering?

Something like: https://fiddle.nette.org/latte/#4e3b1086c4

https://github.com/mlocati/ip-lib https://docs.ansible.com/ansible/3/user_guide/playbooks_filters_ipaddr.html

Izolant avatar Jun 05 '24 22:06 Izolant

You can make your own filter with such functionality. I have made such simple filter for binary ip addresses.

    /**
     * @param string|null $ip
     * @return string
     * @noinspection PhpUnused
     */
    public static function inet_ntop(?string $ip): string {
        if(empty($ip)){
            return '';
        }

        return inet_ntop($ip);
    }

with s1lentium/iptools:dev-master you can fulfill all of the desired functionality.

deba12 avatar Jun 06 '24 08:06 deba12