Skip to content

Commit 2ab3671

Browse files
committed
feat: add postData method
1 parent 4fc9369 commit 2ab3671

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Request.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ public static function urlData($item = null, $default = null)
189189
return \Leaf\Anchor::deepGet($_GET, $item) ?? $default;
190190
}
191191

192+
/**
193+
* Return only get request data
194+
*
195+
* @param string|array $item The items to output
196+
* @param mixed $default The default value to return if no data is available
197+
*/
198+
public static function postData($item = null, $default = null)
199+
{
200+
return \Leaf\Anchor::deepGet($_POST, $item) ?? $default;
201+
}
202+
192203
/**
193204
* Returns request data
194205
*

0 commit comments

Comments
 (0)