« blib/lib/WWW/Shopify/Liquid/Filter/UrlEscape.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Filter/UrlForType.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Filter::UrlForProduct; use base 'WWW::Shopify::Liquid::Filter'; | ||
| 6 | sub max_arguments { return 1; } | ||
| 7 | sub operate { my $str = $_[2]; $str =~ s/\s/-/g; return "/products/" . lc($str); } | ||
| 8 | |||
| 9 | |||
| 10 | 1; |