Создаёт строку параметра для записи в файл

@param string $name     имя параметра
@param string $type     тип: string, bool или int
@param array  $options  опции: nobr (true/false), savebr (true/false)

@return string
199183
private function mkstr($name, $type = 'string', $options = array())
    {
        $result = "  define('$name', ";
        $quot = "'";
        $value = isset($_POST[$name]) ? $_POST[$name] : null;

        if (isset($options['nobr']) && $options['nobr'])
        {
            $value = str_replace(array("\n", "\r"), ' ', $value);
        }

        if (isset($options['savebr']) && $options['savebr'])
        {
            $value = addcslashes($value, "\n\r\"");
            $quot = '"';
        }

        switch ($type)
        {
            case 'string':
                $value = str_replace(
                    array('\\', $quot),
                    array('\\\\', '\\' . $quot),
                    $value
                );
                $value = $quot . $value . $quot;
                break;
            case 'bool':
                $value = $value ? 'true' : 'false';
                break;
            case 'int':
                $value = intval($value);
                break;
        }
        $result .= $value . ");\n";
        return $result;
    }
469271
public function get($name, array $options = [])
    {
        $group = $options['group'];

        $menuItem = $this->menuFactory->createItem($options['name']);

        if (empty($group['on_top']) || false === $group['on_top']) {
            foreach ($group['items'] as $item) {
                if ($this->canGenerateMenuItem($item, $group)) {
                    $menuItem->addChild($this->generateMenuItem($item, $group));
                }
            }

            if (false === $menuItem->hasChildren()) {
                $menuItem->setDisplay(false);
            } elseif (!empty($group['keep_open'])) {
                $menuItem->setAttribute('class', 'keep-open');
                $menuItem->setExtra('keep_open', $group['keep_open']);
            }
        } elseif (1 === \count($group['items'])) {
            if ($this->canGenerateMenuItem($group['items'][0], $group)) {
                $menuItem = $this->generateMenuItem($group['items'][0], $group);
                $menuItem->setExtra('on_top', $group['on_top']);
            } else {
                $menuItem->setDisplay(false);
            }
        }
        $menuItem->setLabel($group['label']);

        return $menuItem;
    }
1068893
public function addImprintElement($type, $name, $label = null, $options = [])
    {
        $imprint = $this->getOption('imprint');
        //brak pól - pusta lista
        if (null === $imprint) {
            $imprint = [];
        }
        $imprint[] = ['type' => $type, 'name' => $name, 'label' => ($label ?: $name), 'options' => $options];
        return $this->setOption('imprint', $imprint);
    }
23554
public function input($name, $options = array())
    {
        $options += array(
            "type"  => "text",
            "id"    => $this->id($name),
            "name"  => $this->name($name),
            "error" => true,
            "class" => "",
            "value" => "",
            "label" => null
        );

        $currentValue = $this->getCurrentValue($options['name']);

        $errorHtml = "";
        $fieldHasErrors = false;

        if (!is_null($this->associatedEntity)) {
            // Checkboxes may be posted has data[name][0] and therefore
            // we need to remove it to get the absolute field name.
            $validationName = $options["type"] === "checkbox" ?
                preg_replace('/\[\d+\]$/', '', $name) :
                $name;

            if ($this->associatedEntity->hasErrors($validationName)) {
                if ((bool)$options['error']) {
                    $errorHtml = $this->generateInlineErrors($validationName);
                }
                $fieldHasErrors = true;
                $options['class'] .= " error ";
            }
        }
        unset($options["error"]);

        $label = "";
        if (!is_null($options['label'])) {
            $labelOptions = array(
                "for"    => $options["id"],
                "class" => $fieldHasErrors ? "error" : "",
                "label" => $options["label"],
            );

            $label .= $this->label($options['name'], $labelOptions);
        }
        unset($options['label']);

        switch (strtolower($options['type'])) {
            case "textarea":
                return $label . "\n" . $this->generateTextarea($options, $currentValue) . $errorHtml . "\n";
            case "select":
                return $label . "\n" . $this->generateSelect($options, $currentValue) . $errorHtml . "\n";
            case "radio":
                return $this->generateRadio($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "checkbox":
                return $this->generateCheckbox($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "hidden":
                return $label . "\n" . $this->generateHidden($options, $currentValue) . $errorHtml . "\n";
            default:
                return $label . "\n" . $this->generateTextinput($options, $currentValue) . $errorHtml . "\n";
        }
    }
980108
public function plugin($name, array $options = [])
    {
        $plugins = $this->getPluginManager();
        return $plugins->get($name, $options);
    }
519198
public function getOption($name)
    {
        if (isset($this->options[$name])) {
            return $this->options[$name];
        }
        return false;
    }
968054
public function text(string $name, array $options = []): FieldTypeInterface
    {
        return (new TextType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
653082
public function createWebService($name, array $options = [])
    {
        $webService = $this->webServiceFactory->createWebService($this->getWebServiceUrl($name), $options);

        if ($webService instanceof EventDispatcherInterface) {
            // Zaregistruj listenery na vytvořeném objektu webové služby, pokud je to podporováno
            foreach ($this->webServiceListeners as $listener) {
                $webService->subscribe($listener['eventName'], $listener['callback']);
            }
        }

        return $webService;
    }
1040197
public function choice(string $name, array $options = []): FieldTypeInterface
    {
        return (new ChoiceType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
945638
public static function buildKeyValidation(array $options, $name)
    {
        if (!key_exists(Properties::TYPE, $options)) {
            trigger_error($name . ' must have a type');
        }

        switch ($options[Properties::TYPE]) {
            case Types::STR:
            case Types::STRING:
                return new StringValidation($name, $options);
            case Types::INT:
            case Types::INTEGER:
                return new IntegerValidation($name, $options);
            case Types::FLOAT:
                return new FloatValidation($name, $options);
            case Types::BOOLEAN:
                return new BooleanValidation($name, $options);
            case Types::ARRY:
                return new ArrayValidation($name, $options);
            default:
                trigger_error(sprintf('%s is unknown', $options[Properties::TYPE]), E_USER_ERROR);
        }
    }
155021
public function getData($name, array $options = [])
    {
        if (false === isset($this->data[$name])) {

            $this->data[$name] = $this->factoryRegistry->getFactory($name)->create(new ParameterBag($options));
        }

        return $this->data[$name];
    }
1164448
protected function getFieldId($name, array $options = [])
    {
        if (Arr::has($options, 'field.id')) {
            return Arr::get($options, 'field.id');
        }

        return 'field-' . str_replace('_', '-', $name);
    }
791738
protected function makeField($name, $type = 'text', array $options = [])
    {
        $this->setupFieldOptions($name, $options);

        $fieldName = $this->getFieldName($name);

        $fieldType = $this->getFieldType($type);

        return new $fieldType($fieldName, $type, $this, $options);
    }
360413
public function getOption($name, $type = null)
    {
        $type = $type ?: $this->getTypeByName($name);
        if (!isset($this->options[$name]) && class_exists($name)) {
            $name = array_search($name, $this->mapping[$type]) ?: $name;
        }
        if (!isset($this->options[$name])) {
            $option = $this->createOption($name, $type);
            $name = $option->getName();
            $this->options[$name] = $option;
            if (!isset($this->mapping[$type][$name])) {
                $this->mapping[$type][$name] = get_class($option);
            }
        }

        return $this->options[$name];
    }
1014655
protected function makeField($name, $type = 'text', array $options = [])
    {
        $this->setupFieldOptions($name, $options);

        $fieldName = $this->getFieldName($name);

        $fieldType = $this->getFieldType($type);

        $field = new $fieldType($fieldName, $type, $this, $options);

        $this->eventDispatcher->dispatch(new AfterFieldCreation($this, $field));

        return $field;
    }
478833
public static function checked($type, $name, $checked = false, $options = [])
    {
        if (!isset($options['name'])) {
            $options['name'] = $name;
        }

        $id = self::getIdAttribute($name, $options);

        $merge = compact('type', 'value', 'id');
        $options = array_merge($options, $merge);

        $checked = !$checked ? '' : 'checked';

        return '<input'.Html::attributes($options)." $checked>";
    }
138679
static function laraform($name = '', $options) {
        $gr = new ElementGroupRadioButtonTwbs();
        $gr->setAttribute('data-toggle', 'buttons');
        foreach ($options as $k => $v) {
            $gr->putRadioTwbs($name, $k)
                ->setAttribute('autocomplete', 'off')
                ->setLabel($v);
        }
        return $gr;
    }