Issues (12)

src/Field/Submit.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Field;
6
7
class Submit extends FieldAbstract
8
{
9
10 6
    public function getTag(): string
11
    {
12 6
        return 'input';
13
    }
14
15 10
    public function init()
16
    {
17 10
        $this->setAttribute('type', 'submit');
18
    }
19
20
    /**
21
     * Submit constructor.
22
     * @param $name
23
     * @param null $value
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $value is correct as it would always require null to be passed?
Loading history...
24
     */
25 10
    public function __construct(string $name, string $value = null)
26
    {
27 10
        $value = is_null($value) ? $name : $value;
28 10
        parent::__construct($name, $value);
29 10
        $this->setClass('btn btn-primary');
30
    }
31
}
32