form attributes resolver

@param ControlContract $control
@return type
486807
protected function attributes(FieldContract $control)
    {
        $attributes          = array_only($control->getAttributes(), ['id', 'name', 'value', 'label', 'type']);
        $attributes['value'] = ($attributes['value'] instanceof Closure) ? '' : $attributes['value'];
        switch ($attributes['type']) {
            case 'select':
                $attributes['options'] = $this->getOptions($control->options);
                break;
        }
        return $attributes;
    }
900499
public function renderControl(Nette\Forms\IControl $control)
	{
		/** @noinspection PhpUndefinedMethodInspection */
		$controlHtml = $control->getControl();
		/** @noinspection PhpUndefinedMethodInspection */
		$control->setOption(RendererOptions::_rendered, TRUE);
		/** @noinspection PhpUndefinedMethodInspection */
		if (($this->form->showValidation || $control->hasErrors()) && $control instanceof IValidationInput) {
			$controlHtml = $control->showValidation($controlHtml);
		}
		$controlHtml = $this->configElem(Cnf::input, $controlHtml);

		return $controlHtml;
	}
611542
function (control) {
				var result = Object.create(null);
				var controlPropertiesFromMetadata = control.getMetadata().getProperties();

				result.meta = Object.create(null);
				result.meta.controlName = control.getMetadata().getName();

				result.properties = Object.create(null);
				Object.keys(controlPropertiesFromMetadata).forEach(function (key) {
					result.properties[key] = Object.create(null);
					result.properties[key].value = control.getProperty(key);
					result.properties[key].type = controlPropertiesFromMetadata[key].getType().getName ? controlPropertiesFromMetadata[key].getType().getName() : '';
				});

				return result;
			}
301179
private function doControlEncode($type, Control $control, Encoder $encoder)
    {
        return sprintf(
            '%s = L.control.%s(%s);',
            $encoder->encodeReference($control),
            $type,
            $encoder->encodeArguments(array($control->getOptions()))
        );
    }
194
public function getControl()
	{
		$control = parent::getControl();
		$control->type = $this->htmlType;
		$control->addClass($this->htmlType);

		list($min, $max) = $this->extractRangeRule($this->getRules());
		if ($min instanceof DateTimeInterface) {
			$control->min = $min->format($this->htmlFormat);
		}
		if ($max instanceof DateTimeInterface) {
			$control->max = $max->format($this->htmlFormat);
		}
		$value = $this->getValue();
		if ($value instanceof DateTimeInterface) {
			$control->value = $value->format($this->htmlFormat);
		}

		return $control;
	}
148897
public function setControl(Control $control)
    {
        $control->checkId();
        $control->addScriptFeature($this);
        $this->control = $control;
        $this->updateScriptEvents();
        return $this;
    }
91948
protected function _renderUrl($control) {
		$params = $this->getUrlParams();
		$params[$this->_pageParam] = $control;
		
		if ($this->_urlAssembler === null) {
			return $this->_baseUrl . '?' . http_build_query($params);
		}
		
		return $this->_urlAssembler->__invoke($params);
	}
1319627
public function validate(CompoundControl $control): bool
  {
    return ($this->data===null) ? ($this->callable)($control) : ($this->callable)($control, $this->data);
  }
1020604
protected function resolveFieldValue(string $name, $row, Fluent $control)
    {
        // Set the value from old input, followed by row value.
        $value = $control->get('value');
        $model = \data_get($row, $name, $this->request->old($name));

        if (! \is_null($model)) {
            return $model;
        }

        // If the value is set from the closure, we should use it instead of
        // value retrieved from attached data. Should also check if it's a
        // closure, when this happen run it.
        if ($value instanceof Closure) {
            $value = $value($row, $control);
        }

        return $value;
    }
270666
public function buildFieldByType($type, $row, Fluent $control)
    {


        $attributes = (array) $control->attributes;

        $html              = $this->html;
        $templates         = $this->templates;
        $data              = $this->buildFluentData($type, $row, $control);
        $method            = $data->get('method');
        $data->options($this->getOptionList($row, $control));
        $data->checked($control->get('checked'));
        $data->optionsData = $control->get('optionsData') ?: [];

        $data->attributes($html->decorate($attributes, Arr::get($templates, $method)));
        if ($type === 'dropzone') {
            $data->label = $control->get('label');
        }
        return $data;
    }
231623
public function setForm($form)
    {
        foreach ($this->namedLinkCompositeField->compositeDatabaseFields() as $field => $spec) {
            $fieldHandle = 'field' . $field;
            $this->{$fieldHandle}->setForm($form);
        }
//		$this->fieldPageID->setForm($form);
//		$this->fieldPageAnchor->setForm($form);
//		$this->fieldFileID->setForm($form);
//		$this->fieldCustomURL->setForm($form);
//		$this->fieldShortcode->setForm($form);
//		$this->fieldTitle->setForm($form);
//		$this->fieldLinkmode->setForm($form);

		parent::setForm($form);

        return $this;
	}
414240
public function getControl(): Html
	{
		$control = parent::getControl();

		$control->addClass('form-daterange');

		$control->readonly = true;
		$control->setAttribute('data-intervals', $this->dayIntervals);

		return $control;
	}
807943
private function validateControl(&$control) {
        $status = true;
        
        // If the control is a pane, validate each control of the pane
        if ($control instanceof \bootbuilder\Pane\Pane) {
            foreach($control->getRawControls() as $panecontrol) {
                if(!$this->validateControl($panecontrol)) $status = false;
            }
            
        }elseif ($control instanceof \bootbuilder\Controls\Control) {
            // Normal control
            if(!$control->isValid()) $status = false;
        }
        
        return $status;
    }
471927
public function removeControl(Control $control)
    {
        $key = array_search($control, $this->controls);

        if ($key !== false) {
            unset($this->controls[$key]);
        }

        return $this;
    }
1217924
public function add(Field $control)
    {
        $renderable = $control instanceof \Illuminate\Contracts\Support\Renderable;


        $control->setField(function ($row, $cont, $templates) use ($control, $renderable) {

            $control = app(Control::class)
                    ->setTemplates($this->control->getTemplates())
                    ->setPresenter($this->control->getPresenter());

            $field = $control->buildFieldByType($cont->type, $row, $cont);
            $cont->setModel($row);
            if (($value = $cont->getValue()) !== false) {
                $field->value($value);
            }
            if ($renderable) {
                return $cont;
            }

            return $control->render([], $field);
        });


        $this->controls[] = $control;
        return $this;
    }
347577
public function findFormControlByName(string $name): ?Control
  {
    foreach ($this->controls as $control)
    {
      if ($control->name===$name) return $control;

      if ($control instanceof ComplexControl)
      {
        $tmp = $control->findFormControlByName($name);
        if ($tmp) return $tmp;
      }
    }

    return null;
  }
21323
public function getInputControlStructure($uri) {
        $url = $this->service_url . '/reports' . $uri . '/inputControls';
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true);

        if (empty($data)) {
            return array();
        }

        $json_obj = json_decode($data);

        $result = array();
        foreach ($json_obj->inputControl as $control) {
            $result[] = InputControl::createFromJSON($control);
        }
        return $result;
    }