PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Http::__construct

(Yaf >=1.0.0)

Yaf_Request_Http::__constructConstructor of Yaf_Request_Http

Beschreibung

public function Yaf_Request_Http::__construct(string $request_uri = ?, string $base_uri = ?)

Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Beispiele

Beispiel #1 Yaf_Request_Http::__construct() example

<?php
/**
 * Build a http request explicitly with an URI and a base URI.
 *
 * If the request URI is omitted, it is retrieved from the usual
 * $_SERVER variables ($_SERVER["PATH_INFO"], $_SERVER["REQUEST_URI"], ...).
 */
$request = new Yaf_Request_Http("/product/detail/id/10", "/product");

var_dump($request->getMethod());
var_dump($request->getRequestUri());
var_dump($request->getBaseUri());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

string(3) "GET"
string(21) "/product/detail/id/10"
string(8) "/product"

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top