Yaf_Request_Abstract::setBaseUri
(Yaf >=1.0.0)
Set base URI
Description
Set base URI, base URI is used when doing routing, in routing phase request URI is used to route a request, while base URI is used to skip the leading part(base URI) of request URI. That is, if comes a request with request URI a/b/c, then if you set base URI to "a/b", only "/c" will be used in routing phase.
generally, you don't need to set this, Yaf will determine it automatically.
Parameters
uirbase URI
Return Values
Returns the request object itself on success, or false on failure.
Examples
Yaf_Request_Abstract::setBaseUri example
<?php
$request = new Yaf_Request_Simple("GET", "Index", "Product", "View");
// The application lives under /myapp,
// requests come in as /myapp/product/view
$request->setBaseUri("/myapp");
$request->setRequestUri("/myapp/product/view");
var_dump($request->getBaseUri());
var_dump($request->getRequestUri());
?>The above example will output something similar to:
string(6) "/myapp"
string(19) "/myapp/product/view"See Also
Yaf_Request_Abstract::getBaseUriYaf_Request_Abstract::setRequestUriYaf_Request_Abstract::getRequestUri