Creates a new template of a given type
@param string $type
@return mixed
7036
protected function createTemplate($type)
    {
        $class = $this->resolveTypeClassName($type);

        if (!($template = $class::inTheme($this->theme))) {
            throw new ApplicationException(trans('cms::lang.template.not_found'));
        }

        return $template;
    }
1069221
public static function getConfigByType($type)
	{
		$configPath = null;

		try {
			$templatePaths = CustomTemplate::getTemplates($type);
			if (!empty($templatePaths[0])) {
				$configPath = substr($templatePaths[0], 0, -6) . '_config.php';
			}
		}
		catch (\Exception $e) {
			$configPath = null;
		}

		if ($configPath === null || !file_exists($configPath)) {
			$allConfigs = array_merge(
				glob(TL_ROOT . '/templates/' . $type . '_config.php') ?: array(),
				glob(TL_ROOT . '/templates/*/' . $type . '_config.php') ?: array()
			);
			if (count($allConfigs)) {
				$configPath = $allConfigs[0];
			}
			else {
				return;
			}
		}

		$config = include $configPath;

		if ($config) {
			$config['fields'] = is_array($config['fields']) ? $config['fields'] : array();
		}

		return $config;
	}
1046498
protected function createProperty($type)
    {
        return $this->getSchema()->getFactory()->createProperty(
            [ 'type' => $type, 'name' => $this->getName().'_item', 'required' => true ],
            $this->getSchema(),
            $this
        );
    }
890914
public static function createObject($type)
    {
        if (\is_string($type)) {
            return static::get($type);
        } elseif (\is_array($type)) {
            if (!isset($type['class'])) {
                throw new InvalidConfigException('Object configuration must be an array containing a "class" element.');
            }

            $class = $type['class'];
            unset($type['class']);

            return static::get($class, $type);
        }

        throw new InvalidConfigException('Unsupported configuration type: ' . \gettype($type));
    }
402558
protected function createDescriptorForType($type)
    {
        if (!$this->isArrayNotation($type)) {
            $className = $this->findClassNameForType($type);

            return $className ? new $className() : new UnknownTypeDescriptor($type);
        }

        $type       = $this->extractTypeFromArrayNotation($type);
        $className  = $this->findClassNameForType($type);
        $descriptor = $className ? new $className() : new UnknownTypeDescriptor($type);
        $descriptor = $this->convertToArrayDescriptor($descriptor);

        return $descriptor;
    }
858956
public static function createWriter($type)
    {
        switch ($type) {
            case self::JSON:
                return new Impl\Json();
            case self::YAML:
                return new Impl\Yaml();
            case self::INI:
                return new Impl\Ini();
            case self::COLUMNS:
                return new Impl\Columns();
            case self::TABLE:
                return new Impl\ConsoleTable();
            case self::MARKDOWN:
                return new Impl\MarkdownTable();
            case self::DUMP:
                return new Impl\Dump();
        }

        throw new UnknownWriterTypeException("Sorry, writer type {$type} is not something I do");
    }
62155
public function withType($type)
    {
        $choices = [
            PriceInterface::TYPE_OWN,
            PriceInterface::TYPE_RENT,
        ];

        Assertion::choice($type, $choices);

        $instance = clone $this;

        $instance->type = $type;

        return $instance;
    }
504783
public function ofType($type)
    {
        $items = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && $page->template() === $type) {
                $items[$path] = $slug;
            }
        }

        $this->items = $items;

        return $this;
    }
297663
public function setType($type)
    {
        if ($type === null) {
            $type = self::TYPE_UNDEFINED;
        }

        $this->type = $type;

        return $this;
    }
50030
public function create(string $type) : ?Controller
    {
        if (\class_exists($type) === false) {
            return $this->fallthrough($type);
        }

        $ref = new \ReflectionClass($type);
        $ctor = $ref->getConstructor();
        if ($ctor === null || $ctor->getNumberOfParameters() === 0) {
            return new $type();
        }

        return $this->fallthrough($type);
    }
472502
protected function generateTemplates($type)
    {
        $templates = config('laravel-sms.templates');
        if (is_string($templates)) {
            $templates = Util::unserializeClosure($templates);
        }
        if (is_callable($templates)) {
            $templates = call_user_func_array($templates, [$this->input(), $type]);
        }
        if (!is_array($templates) || empty($templates)) {
            $key = $type === self::VERIFY_SMS ? self::VERIFY_SMS_TEMPLATE_KEY : self::VOICE_VERIFY_TEMPLATE_KEY;

            return self::getTemplatesByKey($key);
        }
        foreach ($templates as $key => $id) {
            if (is_string($id) && preg_match(self::closurePattern, $id)) {
                $id = Util::unserializeClosure($id);
            }
            if (is_callable($id)) {
                $id = call_user_func_array($id, [$this->input(), $type]);
            }
            if (is_array($id)) {
                $id = $type === self::VERIFY_SMS ? $id[0] : $id[1];
            }
            $templates[$key] = $id;
        }

        return $templates;
    }
543201
public function newConditionCreateStruct(string $type): ConditionCreateStruct
    {
        $struct = new ConditionCreateStruct();
        $struct->type = $type;

        return $struct;
    }
1204155
public function addType($type)
    {
        if (func_num_args() > 1) {
            foreach (func_get_args() as $t) {
                $this->addType($t);
            }
        } else {
            if (is_array($type)) {
                foreach ($type as $t) {
                    $this->addType($t);
                }
            } else {
                if (!$this->typeIsAvailable($type)) {
                    $this->types[] = $type;
                }
            }
        }

        return $this;
    }
1371207
public function create($type, $config)
    {
        $method = $config->get('Cache.DefinitionImpl');
        if ($method === null) {
            return new HTMLPurifier_DefinitionCache_Null($type);
        }
        if (!empty($this->caches[$method][$type])) {
            return $this->caches[$method][$type];
        }
        if (isset($this->implementations[$method]) &&
            class_exists($class = $this->implementations[$method], false)) {
            $cache = new $class($type);
        } else {
            if ($method != 'Serializer') {
                trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING);
            }
            $cache = new HTMLPurifier_DefinitionCache_Serializer($type);
        }
        foreach ($this->decorators as $decorator) {
            $new_cache = $decorator->decorate($cache);
            // prevent infinite recursion in PHP 4
            unset($cache);
            $cache = $new_cache;
        }
        $this->caches[$method][$type] = $cache;
        return $this->caches[$method][$type];
    }
210361
public function generate($type)
    {
        return function ($row, $control, $templates = []) use ($type) {
            $data = $this->buildFieldByType($type, $row, $control);
            return $this->render($templates, $data);
        };
    }
1057771
public static function create($type) {
        switch ($type) {
            case Field::TYPE_CHARACTER:
                return new field\CharacterField;
            case Field::TYPE_DATE:
                return new field\DateField;
            case Field::TYPE_LOGICAL:
                return new field\LogicalField;
            case Field::TYPE_MEMO:
                return new field\MemoField;
            case Field::TYPE_NUMERIC:
                return new field\NumericField;
            default:
                throw new Exception("Unsupported field `$type`");
        }
    }
88833
public function newTargetCreateStruct(string $type): TargetCreateStruct
    {
        $struct = new TargetCreateStruct();
        $struct->type = $type;

        return $struct;
    }