Make input element of type $type.

@param $name
@param string $type

@throws Exception

@return mixed
336465
public static function make($name, $type = 'text')
    {
        $input = 'Terranet\\Administrator\\Filters\\Element\\'.ucfirst($type);

        if (!class_exists($input)) {
            throw new Exception(sprintf('Unknown type: %s', $type));
        }

        return new $input($name);
    }
1159930
public function build($type)
    {
        if (!isset($this->types[$type])) {
            throw new \Exception("Unknown request type.");
        }
        return new $this->types[$type]();
    }
458563
private function getExtension($type, $name)
    {
        if (!$this->extensions[$type]) {
            $this->discoverExtension($type);
        }

        if (array_key_exists($name, $this->extensions[$type])) {
            return $this->extensions[$type][$name];
        }

        return null;
    }
1294769
public function addParameter($type, $name) {

        if ( !in_array($type, self::$rpcvalues) ) throw new InvalidArgumentException("Invalid type for parameter $name");

        if ( empty($name) ) throw new InvalidArgumentException("Missing parameter name");

        $this->signatures[$this->current_signature]["PARAMETERS"][$name] = self::$rpcvalues[$type];

        return $this;

    }
921935
protected function makeIndexDDL($type, $name = null)
    {
        return implode(
            ' ',
            array_filter(
                [
                    strtoupper($type),
                    $name !== null ? '`' . $name . '`' : null,
                    $this->makeIndexedColumnsDDL(),
                    $this->hasComment() ? "COMMENT '" . addslashes($this->getComment()) . "'" : null
                ]
            )
        );
    }
787946
public function requestField(string $type, string $name): void
    {
        $this->fields[$type][] = $name;
        $this->updateUriQuery();
    }
1159363
protected static function createNode(string $name, string $type = 'array')
    {
        return Configuration::getRootNodeWithoutDeprecation(new TreeBuilder($name, $type), $name, $type);
    }
427461
public static function make(ClassMetadataBuilder $builder, $type, $name)
    {
        $type = Type::getType($type);

        $field = $builder->createField($name, $type->getName());

        return new static($field, $builder, $type, $name);
    }
848540
private function instanciateField(string $name, string $type): FieldInterface
    {
        $fieldClass = $this->getFieldClass($type);
        $field = new $fieldClass($name);

        if (!$field instanceof FieldInterface) {
            throw new Exception("Field class \"{$fieldClass}\" must implements ".FieldInterface::class);
        }

        if ($field instanceof TranslatorAwareFieldInterface) {
            $field->setTranslator($this->translator);
        }
        if ($field instanceof TwigAwareFieldInterface) {
            $field->setTwig($this->twig);
        }

        return $field;
    }
1185523
public static function build_id( $type, $name )
	{
		if ( !is_null( static::$id_prefix ) )
		{
			return static::$id_prefix.'-'.static::form_id( $type, $name );
		}
		return static::form_id( $type, $name );
	}
823304
protected function makeRequest($type) {

        if(isset($this->{$type . 'Request'}) && $this->{$type . 'Request'}) {
            $request = app()->make($this->{$type . 'Request'});
            if (!$request instanceof Request) {
                throw new \Exception("Class {$this->{$type . 'Request'}} must be an instance of Illuminate\\Http\\Request");
            }
            return $request;
        }

    }
736096
public function from($type)
    {
        switch ($type) {
            case 'ini':
                $this->data = Ini::decode($this->string);
                break;

            case 'json':
                $this->data = Json::decode($this->string);
                break;

            case 'php':
                $this->data = Php::decode($this->string);
                break;

            case 'xml':
                $this->data = Xml::decode($this->string);
                break;

            case 'yml':
            case 'yaml':
                $this->data = Yaml::decode($this->string);
                break;
            
            default:
                throw new \Exception("Format not supported: " . $type);
        }

        return $this;
    }
988647
public function get($name, $type = self::TYPE_GET, $default = null)
    {
        return (isset($this->vars[$type]) && isset($this->vars[$type][$name])) ? $this->vars[$type][$name] : $default;
    }
506875
private function parseRequiredClass($name, array $input, $type)
    {
        if (isset($input[$name]) && $input[$name] instanceof $type) {
            return $input[$name];
        }

        throw new Exception(sprintf("'%s' must be an instance of '%s'.", $name, $type));
    }
998070
public function begin($name, $type = 'replace')
    {
        $stacks = [$name, $type];
        if (!isset($this->opens[$name])) {
            $stacks[] = $this->placeholder($name);
        } elseif ($this->opens[$name]) {
            throw new BlockException($name, 'is opened');
        }

        $this->opens[$name] = true;
        $this->stacks[] = $stacks;
        ob_start();
    }
1147420
public function createAction($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createActionBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Action type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createActionBuilderForProperty($this->getDataClass(), $name, $options);
    }
30007
public function create($name, $type = null, array $options = [])
    {
        return $this->formBuilder->create($name, $type, $options);
    }