PHP 8.5.10 Released!

Yaf_Request_Http::__construct

(Yaf >=1.0.0)

Yaf_Request_Http::__constructConstructor of Yaf_Request_Http

Description

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

Warning

This function is currently not documented; only its argument list is available.

Parameters

This function has no parameters.

Return Values

Examples

Example #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());
?>

The above example will output something similar to:

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

See Also

add a note

User Contributed Notes

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