original_string: protected function urlCustom($module, $controller, $params): string
      {
          $url = $this->reverse[$module][$controller]['route'];
  
          $getParams = [];
          foreach ($params as $key => $value) {
              // sub-array as GET params
              if (\is_array($value)) {
                  $getParams[$key] = $value;
                  continue;
              }
              $url = str_replace('{$' . $key . '}', $value, $url, $replaced);
              // if not replaced, setup param as GET
              if (!$replaced) {
                  $getParams[$key] = $value;
              }
          }
          // clean optional params
          $url = preg_replace('/\{\$[a-z0-9-_]+\}/i', '', $url);
          // clean regular expression (.*)
          $url = preg_replace('/\(\.\*\)/', '', $url);
          // replace "//" with "/"
          $url = str_replace('//', '/', $url);
  
          if (!empty($getParams)) {
              $url .= '?' . http_build_query($getParams);
          }
          return $this->getBaseUrl() . ltrim($url, '/');
      }
code: protected function urlCustom($module, $controller, $params): string
      {
          $url = $this->reverse[$module][$controller]['route'];
  
          $getParams = [];
          foreach ($params as $key => $value) {
              // sub-array as GET params
              if (\is_array($value)) {
                  $getParams[$key] = $value;
                  continue;
              }
              $url = str_replace('{$' . $key . '}', $value, $url, $replaced);
              // if not replaced, setup param as GET
              if (!$replaced) {
                  $getParams[$key] = $value;
              }
          }
          // clean optional params
          $url = preg_replace('/\{\$[a-z0-9-_]+\}/i', '', $url);
          // clean regular expression (.*)
          $url = preg_replace('/\(\.\*\)/', '', $url);
          // replace "//" with "/"
          $url = str_replace('//', '/', $url);
  
          if (!empty($getParams)) {
              $url .= '?' . http_build_query($getParams);
          }
          return $this->getBaseUrl() . ltrim($url, '/');
      }
code_tokens: protected function urlCustom ( $ module , $ controller , $ params ) : string { $ url = $ this -> reverse [ $ module ] [ $ controller ] [ 'route' ] ; $ getParams = [ ] ; foreach ( $ params as $ key => $ value ) { // sub-array as GET params if ( \ is_array ( $ value ) ) { $ getParams [ $ key ] = $ value ; continue ; } $ url = str_replace ( '{$' . $ key . '}' , $ value , $ url , $ replaced ) ; // if not replaced, setup param as GET if ( ! $ replaced ) { $ getParams [ $ key ] = $ value ; } } // clean optional params $ url = preg_replace ( '/\{\$[a-z0-9-_]+\}/i' , '' , $ url ) ; // clean regular expression (.*) $ url = preg_replace ( '/\(\.\*\)/' , '' , $ url ) ; // replace "//" with "/" $ url = str_replace ( '//' , '/' , $ url ) ; if ( ! empty ( $ getParams ) ) { $ url .= '?' . http_build_query ( $ getParams ) ; } return $ this -> getBaseUrl ( ) . ltrim ( $ url , '/' ) ; }
docstring: Build URL by custom route
  
  @param  string $module
  @param  string $controller
  @param  array  $params
  
  @return string
docstring_tokens: Build URL by custom route