Contao\ImageSize::isValidOption PHP Method

isValidOption() protected method

Check whether an input is one of the given options
protected isValidOption ( mixed $varInput ) : boolean
$varInput mixed The input string or array
return boolean True if the selected option exists
    protected function isValidOption($varInput)
    {
        if ($varInput == '') {
            return true;
        }
        foreach ($this->arrAvailableOptions as $strGroup => $arrValues) {
            if ($strGroup == 'image_sizes') {
                if (isset($arrValues[$varInput])) {
                    return true;
                }
            } elseif (in_array($varInput, $arrValues)) {
                return true;
            }
        }
        return false;
    }