PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::isGet

(Yaf >=1.0.0)

Yaf_Request_Abstract::isGetDetermine if the request is a GET request

Descrizione

public function Yaf_Request_Abstract::isGet(): bool

Checks whether the request was sent with the GET method.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

Example #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());
    }
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

bool(true)
bool(false)

Vedere anche:

add a note

User Contributed Notes

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