/** * Compose URL from target, action and additional params * * @param string $target Page identifier OPTIONAL * @param string $action Action to perform OPTIONAL * @param array $params Additional params OPTIONAL * @param string $interface Interface script OPTIONAL * @param boolean $forceCleanURL Force flag - use Clean URL OPTIONAL * @param boolean $forceCuFlag Force cu flag ?? OPTIONAL * * @return string */ public static function buildURL($target = '', $action = '', array $params = array(), $interface = null, $forceCleanURL = false, $forceCuFlag = null) { $result = null; $cuFlag = null !== $forceCuFlag ? $forceCuFlag : LC_USE_CLEAN_URLS && (!\XLite::isAdminZone() || $forceCleanURL); if ($cuFlag) { $result = static::buildCleanURL($target, $action, $params); } if (null === $result) { if (null === $interface && !$cuFlag) { $interface = \XLite::getInstance()->getScript(); } $result = \Includes\Utils\Converter::buildURL($target, $action, $params, $interface); if ($cuFlag && !$result) { $result = \XLite::getInstance()->getShopURL($result, null, array()); } } return $result; }
/** * Compose URL from target, action and additional params * * @param string $target Page identifier OPTIONAL * @param string $action Action to perform OPTIONAL * @param array $params Additional params OPTIONAL * @param string $interface Interface script OPTIONAL * * @return string */ public static function buildURL($target = '', $action = '', array $params = array(), $interface = null, $forceCleanURL = false) { $result = null; $cuFlag = LC_USE_CLEAN_URLS && (!\XLite::isAdminZone() || $forceCleanURL); if ($cuFlag) { $result = static::buildCleanURL($target, $action, $params); } if (!isset($result)) { if (!isset($interface) && !$cuFlag) { $interface = \XLite::getInstance()->getScript(); } $result = \Includes\Utils\Converter::buildURL($target, $action, $params, $interface); if ($cuFlag && !$result) { $result = \XLite::getInstance()->getShopURL($result, null, array(), \Includes\Utils\URLManager::URL_OUTPUT_SHORT); } } return $result; }