PHP 8.6.0 Beta 3 is available for testing

La clase Yaf_Request_Abstract

(Yaf >=1.0.0)

Introducción

Yaf_Request_Abstract es la clase base de los objetos de petición. Encapsula el entorno de la petición: el módulo, el controlador y la acción resueltos por el enrutamiento, los parámetros de la petición y accesores para las superglobales (cadena de consulta, POST, cookie, servidor, entorno y ficheros subidos).

Se proporcionan dos implementaciones concretas: Yaf_Request_Http, inicializada desde una petición web real, y Yaf_Request_Simple, una petición sintética usada en pruebas y scripts CLI.

Sinopsis de la clase

class Yaf_Request_Abstract {
/* Constantes */
const string SCHEME_HTTP = http;
const string SCHEME_HTTPS = https;
/* Propiedades */
public $module;
public $controller;
public $action;
public $method;
protected $params;
protected $language;
protected $_exception;
protected $_base_uri;
protected $uri;
protected $dispatched;
protected $routed;
/* Métodos */
public function get(string $name, mixed $default = ?): mixed
public function getActionName(): ?string
public function getBaseUri(): ?string
public function getControllerName(): ?string
public function getCookie(string $name = ?, mixed $default = ?): mixed
public function getEnv(string $name, mixed $default = ?): mixed
public function getException(): ?Exception
public function getFiles(string $name = ?, mixed $default = ?): mixed
public function getLanguage(): ?string
public function getMethod(): ?string
public function getModuleName(): ?string
public function getParam(string $name, mixed $default = ?): mixed
public function getParams(): ?array
public function getPost(string $name = ?, mixed $default = ?): mixed
public function getQuery(string $name = ?, mixed $default = ?): mixed
public function getRaw(): ?string
public function getRequest(string $name = ?, mixed $default = ?): mixed
public function getRequestUri(): ?string
public function getServer(string $name, mixed $default = ?): mixed
public function isCli(): bool
public function isDelete(): bool
public function isDispatched(): bool
public function isGet(): bool
public function isHead(): bool
public function isOptions(): bool
public function isPatch(): bool
public function isPost(): bool
public function isPut(): bool
public function isRouted(): bool
public function isXmlHttpRequest(): bool
public function setActionName(string $action, bool $format_name = true): ?Yaf_Request_Abstract
public function setControllerName(string $controller, bool $format_name = true): ?Yaf_Request_Abstract
final public function setDispatched(bool $flag = true): Yaf_Request_Abstract
public function setModuleName(string $module, bool $format_name = true): ?Yaf_Request_Abstract
public function setParam(mixed $name, mixed $value = ?): Yaf_Request_Abstract|bool|null
final public function setRouted(bool $flag = true): Yaf_Request_Abstract
}

Propiedades

module

controller

action

method

params

language

_exception

_base_uri

uri

dispatched

routed

Tabla de contenidos

add a note

User Contributed Notes

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