The Yaf_Request_Abstract class

Introduction

Yaf_Request_Abstract is the base class of the request objects. It encapsulates the request environment: the module, controller and action resolved by routing, the request parameters, and accessors for the superglobals (query string, POST, cookie, server, environment and uploaded files).

Two concrete implementations are provided: Yaf_Request_Http, initialized from an actual web request, and Yaf_Request_Simple, a synthetic request used in tests and CLI scripts.

Class synopsis

Yaf_Request_Abstract
class Yaf_Request_Abstract {
/* Constants */
const string Yaf_Request_Abstract::SCHEME_HTTP = http;
const string Yaf_Request_Abstract::SCHEME_HTTPS = https;
/* Properties */
public $module;
public $controller;
public $action;
public $method;
protected $params;
protected $language;
protected $_exception;
protected $_base_uri;
protected $uri;
protected $dispatched;
protected $routed;
/* Methods */
public Yaf_Request_Abstractnull clearParams()
public mixed get(string $name, mixed $default = ?)
public stringnull getActionName()
public stringnull getBaseUri()
public stringnull getControllerName()
public mixed getCookie(string $name = ?, mixed $default = ?)
public mixed getEnv(string $name, mixed $default = ?)
public Exceptionnull getException()
public mixed getFiles(string $name = ?, mixed $default = ?)
public stringnull getLanguage()
public stringnull getMethod()
public stringnull getModuleName()
public mixed getParam(string $name, mixed $default = ?)
public arraynull getParams()
public mixed getPost(string $name = ?, mixed $default = ?)
public mixed getQuery(string $name = ?, mixed $default = ?)
public stringnull getRaw()
public mixed getRequest(string $name = ?, mixed $default = ?)
public stringnull getRequestUri()
public mixed getServer(string $name, mixed $default = ?)
public bool isCli()
public bool isDelete()
public bool isDispatched()
public bool isGet()
public bool isHead()
public bool isOptions()
public bool isPatch()
public bool isPost()
public bool isPut()
public bool isRouted()
public bool isXmlHttpRequest()
public Yaf_Request_Abstractnull setActionName(string $action, bool $format_name = true)
public Yaf_Request_Abstractfalse setBaseUri(string $uir)
public Yaf_Request_Abstractnull setControllerName(string $controller, bool $format_name = true)
final public Yaf_Request_Abstract setDispatched(bool $flag = true)
public Yaf_Request_Abstractnull setModuleName(string $module, bool $format_name = true)
public Yaf_Request_Abstractboolnull setParam(mixed $name, mixed $value = ?)
public Yaf_Request_Abstract setRequestUri(string $uri)
final public Yaf_Request_Abstract setRouted(bool $flag = true)
}

Properties

module

controller

action

method

params

language

_exception

_base_uri

uri

dispatched

routed

Predefined Constants

Yaf_Request_Abstract::SCHEME_HTTP

Yaf_Request_Abstract::SCHEME_HTTPS

Table of Contents