Get basic template for a given type

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

        return $result;
    }
690713
protected function getTypeConfig($type = null)
    {
        if ($type == null) {
            $type = static::BASE_TYPE;
        }

        if (is_object($type)) {
            $type = $this->getTypeName($type);
        }

        if (!$this->types->containsKey($type)) {
            $this->throwInvalidTypeException($type);
        }

        return $this->types->get($type);
    }
1293241
protected function getFormatter(XType $type)
    {
        $name = $type->getName();

        if (isset($this->formatterCache[$name])) {
            return $this->formatterCache[$name];
        }

        $class = get_class($type);

        if (isset($this->formatterCache[$class])) {
            return $this->formatterCache[$class];
        }

        if (isset($this->_extensions[$name])) {
            $this->formatterCache[$name] = $this->_extensions[$name];
            return $this->formatterCache[$name];
        }

        if ($extension = $this->nearestForClass($class)) {
            $this->formatterCache[$name] = $extension;
            $this->formatterCache[$class] = $extension;
            return $this->formatterCache[$name];
        }

        return $this->ownExtension;
    }
494107
public static function handlers($type = null) {
		$handlers = static::$_handlers + [
			'default' => [
				'view'     => 'lithium\template\View',
				'encode'   => false,
				'decode'   => false,
				'cast'     => false,
				'paths'    => [
					'template' => '{:library}/views/{:controller}/{:template}.{:type}.php',
					'layout'   => '{:library}/views/layouts/{:layout}.{:type}.php',
					'element'  => '{:library}/views/elements/{:template}.{:type}.php'
				]
			],
			'html' => [],
			'json' => [
				'cast' => true,
				'encode' => 'json_encode',
				'decode' => function($data) {
					return json_decode($data, true);
				}
			],
			'text' => ['cast' => false, 'encode' => function($s) { return $s; }],
			'form' => [
				'cast' => true,
				'encode' => 'http_build_query',
				'decode' => function($data) {
					$decoded = [];
					parse_str($data, $decoded);
					return $decoded;
				}
			]
		];

		if ($type) {
			return isset($handlers[$type]) ? $handlers[$type] : null;
		}
		return $handlers;
	}
664522
public function getType(string $type): Type
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        $instance = $this->createType($type);
        $this->addType($instance);
        $this->types[$type] = $instance;

        return $instance;
    }
217599
public function getTemplateContent($type)
    {
        $type = strtolower($type);
        $templateContent = "An error has occured.";
        if ($this->getOptions()->getTemplate($type)
            && file_exists($this->getOptions()->getTemplate($type))) {

            $templatePath = $this->getOptions()->getTemplate($type);
            // read content of file
            $templateContent = file_get_contents($templatePath);
        }

        // TODO: translations?
        return $templateContent;
    }
779043
public static function doctype($type)
    {
        $doctypes = array(
            'html5'        => '<!DOCTYPE html>',
            'xhtml'        => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-trans'  => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
        );

        if ($doctypes[$type]) {
            self::$doctype = preg_replace('/-\w+$/', '', $type);
            return $doctypes[$type];
        }

        return '';
    }
968560
public function createForm(string $type = null): array
    {
        $data = [
            'storageUrl' => $this->getStorageUrl($type),
            'buttons' => $this->getButtons($type),
            'structure' => $this->getStructure($type),
        ];

        if ($this->multiLanguage) {
            $data['languages'] = $this->getContentLanguages();
        }

        return $data;
    }
1217310
public static function groupType($type)
    {
        if ($type == Teamspeak::GROUP_DBTYPE_TEMPLATE) {
            return "Template";
        }
        if ($type == Teamspeak::GROUP_DBTYPE_REGULAR) {
            return "Regular";
        }
        if ($type == Teamspeak::GROUP_DBTYPE_SERVERQUERY) {
            return "ServerQuery";
        }

        return "Unknown";
    }
1357928
public function getAPIByType($type)
    {
        switch ($type) {
            case 'news_image':
                $api = self::API_NEWS_IMAGE_UPLOAD;
                break;
            default:
                $api = self::API_UPLOAD;
        }

        return $api;
    }
860683
protected function getBody( $type )
	{
		$count		= 0;
		$structure	= $this->getMessageStructure();
		foreach( $structure->parts as $part )
		{
			$count++;
			if( $part->type !== 0 )
				continue;
			if( $part->subtype == $type )
			{
				$body	= imap_fetchbody( $this->stream, $this->messageNumber, $count );
				$body	= $this->decodeBody( $body, $part->encoding );
				return $body;
			}
		}
	}
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
22078
public static function format($type)
    {
        switch ($type) {
            case self::TYPE_CREATED:
                return 'Created';

            case self::TYPE_STARTING:
                return 'Starting';

            case self::TYPE_RUNNING:
                return 'Running';

            case self::TYPE_ENDING:
                return 'Ending';

            case self::TYPE_FINISHED:
                return 'Finished';

            case self::TYPE_SUCCESS:
                return 'Success';

            case self::TYPE_FAILURE:
                return 'Failure';

            default:
                return 'Unknown';
        }
    }
1097483
private function type2format( $type ) {
		if ( ! isset( self::$_type2format[ $type ] ) ) {
			$format = '%s';
			switch ( true ) {
				case stristr( $type, 'INT' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'BIT' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'BOOLEAN' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'DECIMAL' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'FLOAT' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'DOUBLE' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'REAL' ) !== false:
					$format = '%f';
					break;
			}
			self::$_type2format[ $type ] = $this->apply_filters( 'type2format', $format, $type );
		}

		return self::$_type2format[ $type ];
	}
552580
public function getForm($type = null)
    {
        if (!isset($this->forms[$type])) {
            $form = $this->getManager()->newForm($type);

            $this->forms[$type] = $this->initForm($form);
        }

        return $this->forms[$type];
    }
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$type];
    }
239242
private static function getVectorParamTemplate($type, $max)
    {
        if (!isset(self::$vectorParamTemplates[$type])) {
            return \sprintf('%%-%ds', $max);
        }

        return \sprintf('<%s>%%-%ds</%s>', self::$vectorParamTemplates[$type], $max, self::$vectorParamTemplates[$type]);
    }