Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Request.php
Go to the documentation of this file.
1 <?php
9 
11 {
15  protected $params;
16 
20  public function __construct(array $parameters = [])
21  {
22  $data = getopt(null, $parameters);
23  // It can happen that request comes from http (e.g. pub/cron.php), but it runs the console
24  if ($data) {
25  $this->setParams($data);
26  } else {
27  $this->setParams([]);
28  }
29  }
30 
36  public function getModuleName()
37  {
38  return;
39  }
40 
48  public function setModuleName($name)
49  {
50  }
51 
57  public function getActionName()
58  {
59  return;
60  }
61 
69  public function setActionName($name)
70  {
71  }
72 
80  public function getParam($key, $defaultValue = null)
81  {
82  if (isset($this->params[$key])) {
83  return $this->params[$key];
84  }
85  return $defaultValue;
86  }
87 
93  public function getParams()
94  {
95  return $this->params;
96  }
97 
104  public function setParams(array $data)
105  {
106  $this->params = $data;
107  return $this;
108  }
109 
118  public function getCookie($name, $default)
119  {
120  }
121 
127  public function isSecure()
128  {
129  return false;
130  }
131 }
getParam($key, $defaultValue=null)
Definition: Request.php:80
__construct(array $parameters=[])
Definition: Request.php:20
if(!isset($_GET['name'])) $name
Definition: log.php:14