Yaf_Request_Abstract::isGet
PHP Manual
PHP Manual»Yaf_Request_Abstract»Yaf_Request_Abstract::isGet

Yaf_Request_Abstract::isGet

(Yaf >=1.0.0)

Yaf_Request_Abstract::isGet — Determine if the request is a GET request

Beschreibung

public function Yaf_Request_Abstract::isGet(): bool

Checks whether the request was sent with the GET method.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns true if the request method is GET, false otherwise.

Beispiele

Beispiel #1 Yaf_Request_Abstract::isGet() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $request = $this->getRequest();

        // Assuming the request was sent with GET /index
        var_dump($request->isGet(), $request->isPost());
    }
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(false)

Siehe auch

To Top