• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TYPO3-Headless / headless / 14022693367

23 Mar 2025 08:26PM UTC coverage: 52.345% (-20.8%) from 73.13%
14022693367

Pull #815

github

web-flow
Merge e0fcdaa4a into a15e1c8c4
Pull Request #815: [FEATURE] Add support for f:form.* viewhelper

0 of 600 new or added lines in 15 files covered. (0.0%)

1105 of 2111 relevant lines covered (52.34%)

5.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Classes/XClass/ViewHelpers/Form/SubmitViewHelper.php
1
<?php
2

3
/*
4
 * This file is part of the "headless" Extension for TYPO3 CMS.
5
 *
6
 * For the full copyright and license information, please read the
7
 * LICENSE.md file that was distributed with this source code.
8
 */
9

10
declare(strict_types=1);
11

12
/*
13
 * This file is part of the TYPO3 CMS project.
14
 *
15
 * It is free software; you can redistribute it and/or modify it under
16
 * the terms of the GNU General Public License, either version 2
17
 * of the License, or any later version.
18
 *
19
 * For the full copyright and license information, please read the
20
 * LICENSE.txt file that was distributed with this source code.
21
 *
22
 * The TYPO3 project - inspiring people to share!
23
 */
24

25
namespace FriendsOfTYPO3\Headless\XClass\ViewHelpers\Form;
26

27
/**
28
 * Creates a submit button.
29
 *
30
 * Examples
31
 * ========
32
 *
33
 * Defaults
34
 * --------
35
 *
36
 * ::
37
 *
38
 *    <f:form.submit value="Send Mail" />
39
 *
40
 * Output::
41
 *
42
 *    {
43
 *      "type": "submit",
44
 *      "value": "Send Mail"
45
 *    }
46
 *
47
 * Dummy content for template preview
48
 * ----------------------------------
49
 *
50
 * ::
51
 *
52
 *    <f:form.submit name="mySubmit" value="Send Mail"><button>dummy button</button></f:form.submit>
53
 *
54
 * Output::
55
 *
56
 *    <input type="submit" name="mySubmit" value="Send Mail" />
57
 */
58
final class SubmitViewHelper extends AbstractFormFieldViewHelper
59
{
60
    public function render(): string
61
    {
NEW
62
        $this->data = json_decode(parent::render(), true);
×
63

NEW
64
        $name = $this->getName();
×
NEW
65
        $this->registerFieldNameForFormTokenGeneration($name);
×
66

NEW
67
        $this->data['type'] = 'submit';
×
NEW
68
        $this->data['value'] = $this->getValueAttribute();
×
NEW
69
        if (!empty($name)) {
×
NEW
70
            $this->data['name'] = $name;
×
71
        }
72

NEW
73
        return json_encode($this->data);
×
74
    }
75
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc