1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13: namespace DcGeneral\Contao;
14:
15: use DcGeneral\InputProviderInterface;
16:
17: 18: 19: 20: 21: 22: 23:
24: class InputProvider implements InputProviderInterface
25: {
26: 27: 28:
29: public function getParameter($strKey, $blnRaw = false)
30: {
31:
32: return \Input::getInstance()->get($strKey);
33: }
34:
35: 36: 37:
38: public function setParameter($strKey, $varValue)
39: {
40: \Input::getInstance()->setGet($strKey, $varValue);
41:
42: return $this;
43: }
44:
45: 46: 47:
48: public function unsetParameter($strKey)
49: {
50: \Input::getInstance()->setGet($strKey, null);
51:
52: return $this;
53: }
54:
55: 56: 57:
58: public function hasParameter($strKey)
59: {
60: return (\Input::getInstance()->get($strKey) !== null);
61: }
62:
63: 64: 65:
66: public function getValue($strKey, $blnRaw = false)
67: {
68: if ($blnRaw)
69: {
70: return \Input::getInstance()->postRaw($strKey);
71: }
72:
73:
74: return \Input::getInstance()->post($strKey);
75: }
76:
77: 78: 79:
80: public function setValue($strKey, $varValue)
81: {
82: \Input::getInstance()->setPost($strKey, $varValue);
83:
84: return $this;
85: }
86:
87: 88: 89:
90: public function unsetValue($strKey)
91: {
92: \Input::getInstance()->setPost($strKey, null);
93:
94: return $this;
95: }
96:
97: 98: 99:
100: public function hasValue($strKey)
101: {
102: return (\Input::getInstance()->post($strKey) !== null);
103: }
104:
105: 106: 107:
108: public function getPersistentValue($strKey)
109: {
110: return \Session::getInstance()->get($strKey);
111: }
112:
113: 114: 115:
116: public function setPersistentValue($strKey, $varValue)
117: {
118: \Session::getInstance()->set($strKey, $varValue);
119:
120: return $this;
121: }
122:
123: 124: 125:
126: public function hasPersistentValue($strKey)
127: {
128: return (\Session::getInstance()->get($strKey) !== null);
129: }
130:
131: 132: 133:
134: public function getRequestUrl()
135: {
136:
137: return \Environment::getInstance()->request;
138: }
139: }
140: