Habari\FormControl::control_type PHP Method

control_type() public method

Get the type of control this is (without the "FormControl" and in lower case) Usually used for template selection
public control_type ( ) : string
return string The type of the control in lower case
    public function control_type()
    {
        static $type = null;
        if (is_null($type)) {
            $class = get_called_class();
            $type = $this->get_setting('control_type', function () use($class) {
                $type = 'unknown';
                if (preg_match('#FormControl(.+)$#i', $class, $matches)) {
                    $type = strtolower($matches[1]);
                }
                return $type;
            });
        }
        return $type;
    }