(Yaf >=1.0.0)
Yaf_Request_Abstract::getBaseUri — Retrieve the base URI
This function has no parameters.
The base URI, or an empty string if not set.
Example #1 Yaf_Request_Abstract::getBaseUri() example
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
$request = $this->getRequest();
// Assuming the application is served under /myapp,
// and the request is /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"