Issues (138)

src/Renderer/Paragraph.php (1 issue)

1
<?php
2
3
use Nip\Form\Renderer\AbstractRenderer;
4
5
class Nip_Form_Renderer_Paragraph extends AbstractRenderer
6
{
7
    public function renderElements()
8
    {
9
        $return = '';
10
11
        $renderRows = $this->renderRows();
12
        if ($renderRows) {
13
            $return .= $renderRows;
14
        }
15
16
        return $return;
17
    }
18
19
    public function renderRows()
20
    {
21
        $elements = $this->getElements();
22
        $return = '';
23
        foreach ($elements as $element) {
24
            $return .= $this->renderRow($element);
25
        }
26
27
        return $return;
28
    }
29
30
    public function renderRow($element)
31
    {
32
        $return = '';
33
        if (!$element->isRendered()) {
34
            $return .= '<p class="row row-' . $element->getUniqueId() . ($element->isError() ? ' error' : '') . '">';
35
36
            $return .= $this->renderLabel($element);
0 ignored issues
show
Deprecated Code introduced by
The function Nip\Form\Renderer\AbstractRenderer::renderLabel() has been deprecated: Use renderElementLabel() ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

36
            $return .= /** @scrutinizer ignore-deprecated */ $this->renderLabel($element);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
37
38
            $class = "value " . ($element->getType() == 'input' ? 'input' : '');
39
            $return .= '<span class="' . $class . '">';
40
            $return .= $element->renderElement();
41
            $return .= '</span>';
42
43
            $return .= $element->renderErrors();
44
45
            $return .= '</p>';
46
        }
47
48
        return $return;
49
    }
50
}
51