Contao\Widget::getPost PHP Method

getPost() protected method

Find and return a $_POST variable
protected getPost ( string $strKey ) : mixed
$strKey string The variable name
return mixed The variable value
    protected function getPost($strKey)
    {
        $strMethod = $this->allowHtml ? 'postHtml' : 'post';
        if ($this->preserveTags) {
            $strMethod = 'postRaw';
        }
        // Support arrays (thanks to Andreas Schempp)
        $arrParts = explode('[', str_replace(']', '', $strKey));
        $varValue = \Input::$strMethod(array_shift($arrParts), $this->decodeEntities);
        foreach ($arrParts as $part) {
            if (!is_array($varValue)) {
                break;
            }
            $varValue = $varValue[$part];
        }
        return $varValue;
    }