'Moved Permanently', self::HTTP_FOUND => 'Found', ); if (!isset($url)) { $url = self::getCurrentAction(); } header (sprintf ('%s %s %s', $_SERVER ['SERVER_PROTOCOL'], $code, $codes [$code])); header ('Location: ' . $url); exit; } static function href ($href = null, $full = false) { if (!isset($href)) { return self::getCurrentAction(); } $env = Zend_Registry::getInstance()->Environment; if (preg_match('~^/{2}~', $href)) { $result = preg_replace('~^//~', '/', $href, 1); } else if (preg_match('~^/{1}~', $href)) { $result = self::getCurrentAction($href); } else { $result = '/' . Router::$current_uri . '/' . $href; } if ($full) { if ($env->SITE_DOMAIN) { $result = $env->SITE_DOMAIN . $result; } else { $result = rtrim (Setting_Model::get (Setting_Model::S_SITE_URL), '/') . $result; } } else { $result = SITE_DIR . $result; } return $result; } static function getCurrentAction ($postfix = null) { $result = uri::$segments; $result = SITE_DOMAIN . '/' . join('/', array_slice($result, 0, 2)); if (isset($postfix)) { $result .= $postfix; } return $result; } static function getSiteRootUrl () { return Setting_Model::get (Setting_Model::S_SITE_URL); } }