original_string: public static function routeToLink($strRoute, $ctrlLinkPrefix = null)
      {
          if (empty($ctrlLinkPrefix)) {
              static::_prepare();
              $ctrlLinkPrefix = Url::toRoute([static::$_sysControllerUid]);
          }
          $strRoute = trim($strRoute);
          $url = $route = false;
          if (substr($strRoute, 0, 1) == '=') {  // external link begin with '='
              $url = trim(substr($strRoute, 1));
              //$url = urlencode($url);
          } else {
              if (substr($strRoute, 0, 1) == '[') {  // array-string
                  $route = static::convertRouteStrToArray($strRoute);  // convert string array definition to array
              } elseif (substr($strRoute, 0, 1) == '/') {  // internal link
                  $route = $strRoute;
              }
              if (!$route) {
                  $url = false;
              } else {
                  try {
                      $url = Url::toRoute($route);
                      $parts = parse_url($url);
                      if (0 === strpos($parts['path'], $ctrlLinkPrefix)) {  // illegal link
                          static::$errorRouteConvert = "Illegal link resolved";
                          $url = false;
                      }
                  } catch (InvalidParamException $ex) {
                      static::$errorRouteConvert = $ex->getMessage();
                      $url = false;
                  }
              }
          }
          return $url;
      }
code: public static function routeToLink($strRoute, $ctrlLinkPrefix = null)
      {
          if (empty($ctrlLinkPrefix)) {
              static::_prepare();
              $ctrlLinkPrefix = Url::toRoute([static::$_sysControllerUid]);
          }
          $strRoute = trim($strRoute);
          $url = $route = false;
          if (substr($strRoute, 0, 1) == '=') {  // external link begin with '='
              $url = trim(substr($strRoute, 1));
              //$url = urlencode($url);
          } else {
              if (substr($strRoute, 0, 1) == '[') {  // array-string
                  $route = static::convertRouteStrToArray($strRoute);  // convert string array definition to array
              } elseif (substr($strRoute, 0, 1) == '/') {  // internal link
                  $route = $strRoute;
              }
              if (!$route) {
                  $url = false;
              } else {
                  try {
                      $url = Url::toRoute($route);
                      $parts = parse_url($url);
                      if (0 === strpos($parts['path'], $ctrlLinkPrefix)) {  // illegal link
                          static::$errorRouteConvert = "Illegal link resolved";
                          $url = false;
                      }
                  } catch (InvalidParamException $ex) {
                      static::$errorRouteConvert = $ex->getMessage();
                      $url = false;
                  }
              }
          }
          return $url;
      }
code_tokens: public static function routeToLink ( $ strRoute , $ ctrlLinkPrefix = null ) { if ( empty ( $ ctrlLinkPrefix ) ) { static :: _prepare ( ) ; $ ctrlLinkPrefix = Url :: toRoute ( [ static :: $ _sysControllerUid ] ) ; } $ strRoute = trim ( $ strRoute ) ; $ url = $ route = false ; if ( substr ( $ strRoute , 0 , 1 ) == '=' ) { // external link begin with '=' $ url = trim ( substr ( $ strRoute , 1 ) ) ; //$url = urlencode($url); } else { if ( substr ( $ strRoute , 0 , 1 ) == '[' ) { // array-string $ route = static :: convertRouteStrToArray ( $ strRoute ) ; // convert string array definition to array } elseif ( substr ( $ strRoute , 0 , 1 ) == '/' ) { // internal link $ route = $ strRoute ; } if ( ! $ route ) { $ url = false ; } else { try { $ url = Url :: toRoute ( $ route ) ; $ parts = parse_url ( $ url ) ; if ( 0 === strpos ( $ parts [ 'path' ] , $ ctrlLinkPrefix ) ) { // illegal link static :: $ errorRouteConvert = "Illegal link resolved" ; $ url = false ; } } catch ( InvalidParamException $ ex ) { static :: $ errorRouteConvert = $ ex -> getMessage ( ) ; $ url = false ; } } } return $ url ; }
docstring: Convert route to link.
  @param string $strRoute string representation of route in PHP5.4+ []-notation
  @param string $ctrlLinkPrefix current controller links prefix
  @return string|false
docstring_tokens: Convert route to link .