public static function getUrlFromCode($code, $addedArgs = array(), $anchor = null)
  {
    self::initialize();

    $code = self::clearQueryArg($code);

    if ($code == '_root') {
      return WebApp::url();
    }

    if (StringTools::right($code, 1) != '/') {
      $code .= '/';
    }

    $args = array('q' => $code);
    $args = array_merge($args, $addedArgs);
    return Url::getUrl(null, $args, true, $anchor);
  }