Yaf_Request_Abstract::getBaseUri

(Yaf >=1.0.0)

Yaf_Request_Abstract::getBaseUriRetrieve the base URI

Опис

public function Yaf_Request_Abstract::getBaseUri(): ?string

Retrieve the base URI

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

The base URI, or an empty string if not set.

Приклади

Приклад #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());
    }
}
?>

Поданий вище приклад виведе щось схоже на:

string(6) "/myapp"
string(19) "/myapp/product/view"

Прогляньте також

add a note

User Contributed Notes

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