(Yaf >=3.2.2)
Yaf_Request_Abstract::getRequest — Fetch a REQUEST variable
Retrieves a variable from $_REQUEST.
nameThe variable name. If omitted, the whole array is returned.
defaultThe value to return if the variable is not found.
The $_REQUEST variable value, or default if it is not set.
Exemplo #1 Yaf_Request_Abstract::getRequest() example
<?php
class SearchController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// Assuming the request is /search?keyword=yaf
$keyword = $this->getRequest()->getRequest("keyword");
$source = $this->getRequest()->getRequest("source", "web");
var_dump($keyword, $source);
}
}
?>O exemplo acima produzirá algo semelhante a:
string(3) "yaf" string(3) "web"