Dutch PHP Conference 2027

Yaf_Request_Abstract::isGet

(Yaf >=1.0.0)

Yaf_Request_Abstract::isGetDetermine 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

add a note

User Contributed Notes

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