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
|
|||
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 |
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.