Returns the form action's absolute URL.

@param \Symfony\Component\DomCrawler\Crawler $form
@return string
@throws \Codeception\Exception\TestRuntimeException if either the current
URL or the URI of the form's action can't be parsed
191895
protected function getFormUrl(Crawler $form)
    {
        $action = $form->form()->getUri();
        return $this->getAbsoluteUrlFor($action);
    }
602629
public function getSubmittedName(FormInterface $form)
    {
        foreach ($form as $field) {
            if ($field instanceof ClickableInterface && $field->isClicked()) {
                return $field->getName();
            }
        }

        return null;
    }
1316019
public function getAction()
    {
        if ($this->action) {
            return $this->action;
        }

        if ($this->isMode(static::MODE_EDIT)) {
            return $this->form->resource().'/'.$this->id;
        }

        if ($this->isMode(static::MODE_CREATE)) {
            return $this->form->resource(-1);
        }

        return '';
    }
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;
	}
815275
public function findFormClassName()
    {
        $this->runIfNotCached(
            'formClassName',
            function () {
                return $this->findFormTag()->attr(self:: FORM_CLASS_NAME_ATTR_NAME);
            }
        );

        return $this->formClassName;
    }
294109
public function form(Form $form)
    {
        $tag = new Tag('form');
        $tag->setAttribute('action', $form->getAction());
        $tag->setAttribute('accept', $form->getAccept());
        $tag->setAttribute('accept-charset', $form->getAcceptCharset());
        $tag->setAttribute('enctype', $form->getEnctype());
        $tag->setAttribute('method', $form->getMethod());
        $tag->setAttribute('target', $form->getTarget());

        $html = $this->parseTag($tag, $form);

        $fields = $form->getFieldsByClass('HiddenField');

        if (sizeof($fields) > 0) {
            $html .= '<ins>' . PHP_EOL;

            foreach ($fields as $field) {
                // hidden fields
                $tag = new Tag('input');
                $tag->setAttribute('type', 'hidden');

                $html .= $this->parseTag($tag, $field) . PHP_EOL;
            }
            $html .= '</ins>' . PHP_EOL;
        }

        return $html;
    }
53368
public function actionUrl($action = null, $path = null)
    {
        if ($action === null) {
            $action = $this->action;
        }

        $class = get_called_class();
        $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class))));
        $controllerName = strtolower(class_basename($class));

        $url = $uriPath.'/'.$controllerName.'/'.$action;
        if ($path) {
            $url .= '/'.$path;
        }

        return Backend::url($url);
    }
240114
protected function getTargetUrl($request)
    {
        $queries = Arr::except($request->query(), ['code', 'state']);

        return $request->url().(empty($queries) ? '' : '?'.http_build_query($queries));
    }
126271
public function action($action)
    {
        $a = func_get_args();
        $controllerPath = $this->controller->getControllerActionPath();
        array_unshift($a, $controllerPath);
        $ret = call_user_func_array([$this, 'url'], $a);

        return $ret;
    }
353541
protected function getForm($button = null)
    {
        // If the first argument isn't a string, that means
        // the user wants us to auto-find the form.

        try {
            if ($button) {
                return $this->crawler->selectButton($button)->form();
            }

            return $this->crawler->filter('form')->form();
        } catch (InvalidArgumentException $e) {
            // We'll catch the exception, in order to provide a
            // more readable failure message for the user.

            throw new InvalidArgumentException(
                "Couldn't find a form that contains a button with text '{$button}'."
            );
        }
    }
847003
private function getFormNodeId(\DOMElement $form)
    {
        return md5($form->getLineNo() . $form->getNodePath() . $form->nodeValue);
    }
1348445
protected function _getActionPath(Request $request): string
    {
        $action = $request->getPath();
        if ($action) {
            $action = '/'.\ltrim($action, '/');
        }

        if (!Util::isDateMathEscaped($action)) {
            $action = Util::escapeDateMath($action);
        }

        $query = $request->getQuery();

        if (!empty($query)) {
            $action .= '?'.\http_build_query(
                $this->sanityzeQueryStringBool($query)
                );
        }

        return $action;
    }
2101
public function getPrmForUrl(Form $form)
    {
        $ret = array();
        foreach ($form->getData() as $k => $data) {
            if (isset($data['value'])) {
                $data['value'] = $this->prepareDataForUrl($data['value'], $form->get($k)->get('value'));
                $ret[$k] = $data;
            }
        }

        return count($ret) ? array($form->getName() => $ret) : array();
    }
1014090
protected function extractFormValues(Form $form)
    {
        $values = array();

        foreach ($form->getChildrenByType('\\Zepi\\Web\\UserInterface\\Form\\Field\\FieldAbstract', true) as $field) {
            if ($field->getValue() === null) {
                continue;
            }
            
            $values[$field->getPath($form)] = $field->getValue();
        }
        
        return $values;
    }
384361
protected function getFormStackHash(BaseForm $form, SymfonyForm $field = null)
    {
        $build = get_class($form) . ":" . $form->getType();

        if (null !== $field) {
            $build .= ":" . $this->buildFieldName($field);
        }

        return md5($build);
    }
518718
protected function getFormActionUri()
    {
        /** @var ActionRequest $actionRequest */
        $actionRequest = $this->controllerContext->getRequest();
        $uri = $actionRequest->getHttpRequest()->getUri();
        if ($this->hasArgument('section')) {
            $uri = preg_replace('/#.*$/', '', $uri) . '#' . $this->arguments['section'];
        }
        return (string)$uri;
    }
202366
public function openTag()
    {
        return '<form'.
               ' method="'.esc_attr($this->cfg->method).'"'.

               ($this->action
                    ? ' action="'.esc_url($this->s::restActionUrl($this->action)).'"'
                    : ' action="'.esc_url($this->cfg->action_url).'"'
               ).// NOTE: The `action` can also be empty.

               ' enctype="multipart/form-data"'.
               ' accept-charset="utf-8"'.
               ' autocomplete="off"'.
               '>';
    }