getDisabled example

public function isRequired(): bool
    {
        return false;
    }

    public function isDisabled(): bool
    {
        if ($this->parent?->isDisabled()) {
            return true;
        }

        return $this->config->getDisabled();
    }

    /** * Unsupported method. */
    public function isEmpty(): bool
    {
        return true;
    }

    /** * Unsupported method. */


    /** * Submits data to the button. * * @return $this * * @throws Exception\AlreadySubmittedException if the form has already been submitted */
    public function submit(array|string|null $submittedData, bool $clearMissing = true)static
    {
        if ($this->getConfig()->getDisabled()) {
            $this->clicked = false;

            return $this;
        }

        parent::submit($submittedData$clearMissing);

        $this->clicked = null !== $submittedData;

        return $this;
    }
}

        if (null === $this->parent || $this->parent->isRequired()) {
            return $this->config->getRequired();
        }

        return false;
    }

    public function isDisabled(): bool
    {
        if (null === $this->parent || !$this->parent->isDisabled()) {
            return $this->config->getDisabled();
        }

        return true;
    }

    public function setParent(FormInterface $parent = null)static
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }

        
Home | Imprint | This part of the site doesn't use cookies.