Fix Params class at empty values.

This commit is contained in:
kj 2020-03-13 22:41:48 -04:00
parent f5967591e1
commit b8d4f92ddc

View File

@ -3,14 +3,18 @@
namespace Libs;
class Params {
private $data;
public function __construct($args){
$this->data = [];
foreach($args as $index => $value){
$this->$index = $value;
$this->data[$index] = $value;
}
}
public function __get($index){
return (isset($this->$index) && $this->$index != '') ? urldecode($this->$index) : null;
return (isset($this->data[$index]) && $this->data[$index] != '') ? urldecode($this->data[$index]) : null;
}
}