ShoppingCart_Controller::build_url PHP Method

build_url() protected static method

Helper for creating a url
protected static build_url ( $action, $buyable, $params = [] )
    protected static function build_url($action, $buyable, $params = array())
    {
        if (!$action || !$buyable) {
            return false;
        }
        if (SecurityToken::is_enabled() && !self::config()->disable_security_token) {
            $params[SecurityToken::inst()->getName()] = SecurityToken::inst()->getValue();
        }
        return self::config()->url_segment . '/' . $action . '/' . $buyable->class . "/" . $buyable->ID . self::params_to_get_string($params);
    }