<<

NAME

ProductOpener::URL - generates the URL of the product

SYNOPSIS

ProductOpener::URL is used to generate a URL of the product according to the subdomain .

        use ProductOpener::URL qw/:all/;

        my $image = "$BASE_DIRS{PRODUCTS_IMAGES}/$path/$filename.full.jpg";
        my $image_url = format_subdomain('static') . "/images/products/$path/$filename.full.jpg";
        
        # subdomain format:
        # [2 letters country code or "world" or "static"]

DESCRIPTION

The module implements the URL generation on the basis of subdomain format which can be country code, world or static and on the basis of subdomain's support for https or http.

FUNCTIONS

format_subdomain( SUBDOMAIN )

format_subdomain() returns URL on the basis of subdomain and scheme (http/https)

Arguments

A scalar variable to indicate the subdomain (e.g. "us" or "static") needs to be passed as an argument.

Return Values

The function returns a URL by concatenating scheme, subdomain and server-domain.

subdomain_supports_https( SUBDOMAIN )

subdomain_supports_https() determines if the subdomain supports https.

Arguments

A scalar variable to indicate the subdomain (e.g. "us" or "static") needs to be passed as an argument.

Return Values

The function returns true after evaluating the true value for the regular expression using grep or subdomain, ssl_subdomains

<<