Get Form Class name by type

@param string $type Type name

@return string
507751
public function getFormClassName($type = null)
    {
        if (!$type) {
            $type = $this->getFormTypeDefault();
        }

        $module = $this->getRequest()->getModuleName();
        if (strpos($type, 'admin-') !== false) {
            $module = 'admin';
            $type = str_replace('admin-', '', $type);
        } elseif (strpos($type, 'default-') !== false) {
            $type = str_replace('default-', '', $type);
        }

        $name = ucfirst($module) . '_Forms_';
        $name .= $this->getFormClassNameSlug() . '_';
        $name .= inflector()->classify($type);

        return $name;
    }
339674
public static function getClassnameByContentType($type)
    {
        try {
            return self::getFullClassname(str_replace('/', NAMESPACE_SEPARATOR, $type));
        } catch (\InvalidArgumentException $e) {
            throw new InvalidContentTypeException($type);
        }
    }
935903
public function get_type_info($type){
		$path_base_dir = __DIR__.'/../templates/';
		if( !is_dir( $path_base_dir.'form_elms/'.urlencode($type).'/' ) ){
			$type = 'text';
		}
		$rtn = array();
		$rtn['type'] = $type;
		$rtn['templates'] = array();
		$rtn['templates']['input'] = 'form_elms/'.urlencode($type).'/input.html';
		$rtn['templates']['preview'] = 'form_elms/'.urlencode($type).'/preview.html';
		$rtn['validate'] = include($path_base_dir.'form_elms/'.urlencode($type).'/validate.php');
		return $rtn;
	}
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
528208
public function getType($type)
    {
        $aliases = array(
            'int'    => 'integer',
            'bool'   => 'boolean',
            'double' => 'float',
            'object' => '\\stdClass'
        );
        $default = array(
            'integer', 'boolean', 'float', '\\stdClass', 'callable', 'string', 'resource', 'void', 'mixed'
        );
        $typeHintEnabled = false;

        if (isset($aliases[$type])) {
            $type = $aliases[$type];
        }

        if (!in_array($type, $default)) {
            $typeHintEnabled = true;
        }

        return array(
            'name' => $type,
            'hint' => $typeHintEnabled
        );
    }
694060
protected function _getMethodNameForType($type = null) {
		$result = '_getValueForString';
		if (empty($type)) {
			return $result;
		}

		$type = mb_strtolower($type);
		$methodName = '_getValueFor' . Inflector::camelize($type);
		if (method_exists($this, $methodName)) {
			$result = $methodName;
		}

		return $result;
	}
113536
private static function getModelClassFromEventType($type)
    {
        return self::isKnownEntityType($type)
            ? self::$eventTypeToModelClassMap[$type]
            : self::DEFAULT_EVENT_MODEL_CLASS;
    }
1138349
public function getFieldFor($type)
    {
        if (!isset($this->typemap[$type])) {
            return false;
        }
        $class = $this->typemap[$type];

        return $this->get($class, ['type' => $type]);
    }
467393
public static function nameByType($type)
    {
        switch ($type) {
            case self::TOKEN_BOOLEAN_FALSE: return 'BOOLEAN_FALSE';
            case self::TOKEN_BOOLEAN_TRUE: return 'BOOLEAN_TRUE';
            case self::TOKEN_BRACE_CLOSE: return 'BRACE_CLOSE';
            case self::TOKEN_BRACE_OPEN: return 'BRACE_OPEN';
            case self::TOKEN_COLON: return 'COLON';
            case self::TOKEN_COMMA: return 'COMMA';
            case self::TOKEN_FLOAT: return 'FLOAT';
            case self::TOKEN_GREATER_THAN: return 'GREATER_THAN';
            case self::TOKEN_INTEGER: return 'INTEGER';
            case self::TOKEN_LESS_THAN: return 'LESS_THAN';
            case self::TOKEN_NULL: return 'NULL';
            case self::TOKEN_PIPE: return 'PIPE';
            case self::TOKEN_PLUS: return 'PLUS';
            case self::TOKEN_SQUARE_BRACKET_CLOSE:
                return 'SQUARE_BRACKET_CLOSE';
            case self::TOKEN_SQUARE_BRACKET_OPEN: return 'SQUARE_BRACKET_OPEN';
            case self::TOKEN_STRING: return 'STRING';
            case self::TOKEN_STRING_QUOTED: return 'STRING_QUOTED';
            case self::TOKEN_TYPE_NAME: return 'TYPE_NAME';
            case self::TOKEN_WHITESPACE: return 'WHITESPACE';
        }

        return null;
    }
349928
protected function getBasicTemplate(string $type) : string
    {
        $view = $this->config->getView();
        $result = $view->Form->control('{{name}}', [
            'value' => '{{value}}',
            'type' => $type,
            'label' => false
        ]);

        return $result;
    }
456149
protected function getTypeCategory($type)
    {
        $extensions = $this->extensions;
        $navClasses = 'app';
        if (isset($type)) {
            if ($type->name == 'Yii' || $type->name == 'YiiRequirementChecker') {
                $navClasses = 'yii';
            } elseif (strncmp($type->name, 'yii\\', 4) == 0) {
                $navClasses = 'yii';
                $subName = substr($type->name, 4);
                if (($pos = strpos($subName, '\\')) !== false) {
                    $subNamespace = substr($subName, 0, $pos);
                    if (in_array($subNamespace, $extensions)) {
                        $navClasses = $subNamespace;
                    }
                }
            }
        }

        return $navClasses;
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
44470
private static function getFromCache($type)
    {
        if (!isset(self::$cache[$type])) {
            return;
        }

        $candidate = self::$cache[$type];
        if (isset($candidate['condition'])) {
            if (!self::evaluateCondition($candidate['condition'])) {
                return;
            }
        }

        return $candidate['class'];
    }
1033189
public static function formTypeToString($formType)
    {
        if ($formType instanceof FormTypeInterface) {
            return get_class($formType);
        }

        if (is_string($formType)) {
            return $formType;
        }

        throw new RuntimeException(
            sprintf(
                'Unable to determine form type for %s. Expected string or instance of %s',
                is_object($formType) ? get_class($formType) : gettype($formType),
                FormInterface::class
            )
        );
    }
355795
protected function getPhpType(Type $type): string
    {
        switch ($builtinType = $type->getBuiltinType()) {
            case Type::BUILTIN_TYPE_ARRAY:
            case Type::BUILTIN_TYPE_INT:
            case Type::BUILTIN_TYPE_FLOAT:
            case Type::BUILTIN_TYPE_BOOL:
            case Type::BUILTIN_TYPE_STRING:
                return $builtinType;
            case Type::BUILTIN_TYPE_OBJECT:
                if (null !== ($className = $type->getClassName()) && is_a($className, \DateTimeInterface::class, true)) {
                    return \DateTimeInterface::class;
                }

            // no break
            default:
                return 'string';
        }
    }
1099332
public function getGeneratorMethod($type)
    {
        switch ($type) {
            case in_array($type, $this->inputGroups['hidden']):
                return 'makeHidden';

            case in_array($type, $this->inputGroups['text']):
                return 'makeText';

            case in_array($type, $this->inputGroups['select']):
                return 'makeSelected';

            case in_array($type, $this->inputGroups['checkbox']):
                return 'makeCheckbox';

            case in_array($type, $this->inputGroups['radio']):
                return 'makeRadio';

            case in_array($type, $this->inputGroups['relationship']):
                return 'makeRelationship';

            default:
                return 'makeHTMLInputString';
        }
    }
107489
public function getModelName($type = 'plural')
    {
        $property = $type . 'ModelName';
        if ($this->$property == null) {
            $model = $this->getModel();
            $this->$property = $model->getModelName($type);
        }
        return $this->$property;
    }