Pagekit\Application\UrlProvider::get PHP Метод

get() публичный Метод

Gets the URL appending the URI to the base URI.
public get ( string $path = '', mixed $parameters = [], mixed $referenceType = UrlGenerator::ABSOLUTE_PATH ) : string
$path string
$parameters mixed
$referenceType mixed
Результат string
    public function get($path = '', $parameters = [], $referenceType = UrlGenerator::ABSOLUTE_PATH)
    {
        if (0 === strpos($path, '@')) {
            return $this->getRoute($path, $parameters, $referenceType);
        }
        $path = $this->parseQuery($path, $parameters);
        if (filter_var($path, FILTER_VALIDATE_URL) !== false) {
            return $path;
        }
        return $this->base($referenceType) . '/' . ltrim($path, '/');
    }

Usage Example

Пример #1
0
 /**
  * Returns a redirect response.
  *
  * @param  string  $url
  * @param  array   $parameters
  * @param  int     $status
  * @param  array   $headers
  * @return RedirectResponse
  */
 public function redirect($url, $parameters = [], $status = 302, $headers = [])
 {
     return new RedirectResponse($this->url->get($url, $parameters), $status, $headers);
 }
All Usage Examples Of Pagekit\Application\UrlProvider::get