PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::getMethod

(Yaf >=1.0.0)

Yaf_Request_Abstract::getMethodRetrieve the request method

Descrizione

public function Yaf_Request_Abstract::getMethod(): ?string

Retrieve the request method

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

The request method as a string, e.g. GET, POST, PUT, DELETE.

Esempi

Example #1 Yaf_Request_Abstract::getMethod() example

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

        // Assuming the request was sent with POST /order/save
        var_dump($request->getMethod());
    }
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

string(4) "POST"

Vedere anche:

add a note

User Contributed Notes

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