Templating/Helper/Action/ActionHelper.php
public function create($actionOptions, $contextOptions = null)
    {
        if (!($actionOptions instanceof ActionOptions)) {
            $actionOptions = new ActionOptions($actionOptions);
        }
        if (\is_null($contextOptions) || !\is_array($contextOptions)) {
            $contextOptions = [];
        }

        $url = $this->getActionUrl($actionOptions, $contextOptions);

        if ('input' === $actionOptions->tag) {
            $element = new HtmlElement('input', null, $actionOptions->attrs + [
                'type' => 'submit',
                'formaction' => $url ? $url : null,
                'value' => $actionOptions->label,
                'name' => $actionOptions->name,
            ]);
        } else {
            $element = new HtmlElement('a', $actionOptions->label, $actionOptions->attrs + ['href' => $url]);
        }

        foreach ($actionOptions->data as $dataKey => $dataValue) {
            $element->data()->set($dataKey, $dataValue);
        }
        $element->classes()->add($actionOptions->class);

        return $element;
    }
public function create($actionOptions, $contextOptions = null)
    {
        if (!($actionOptions instanceof ActionOptions)) {
            $actionOptions = new ActionOptions($actionOptions);
        }
        if (\is_null($contextOptions) || !\is_array($contextOptions)) {
            $contextOptions = [];
        }

        $url = $this->getActionUrl($actionOptions, $contextOptions);

        if ('input' === $actionOptions->tag) {
            $element = new HtmlElement('input', null, $actionOptions->attrs + [
                'type' => 'submit',
                'formaction' => $url ? $url : null,
                'value' => $actionOptions->label,
                'name' => $actionOptions->name,
            ]);
        } else {
            $element = new HtmlElement('a', $actionOptions->label, $actionOptions->attrs + ['href' => $url]);
        }

        foreach ($actionOptions->data as $dataKey => $dataValue) {
            $element->data()->set($dataKey, $dataValue);
        }
        $element->classes()->add($actionOptions->class);

        return $element;
    }
@param ActionOptions|array $actionOptions
@param array|null          $contextOptions

@return HtmlElement