Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function render($template, $context = null) |
||
39 | { |
||
40 | $output = ''; |
||
41 | foreach ((array)$this->properties as $prop => $value) { |
||
42 | if (is_callable($value)) { |
||
43 | $val = $value($context); |
||
44 | } else { |
||
45 | $val = $value; |
||
46 | } |
||
47 | $output .= str_replace(['{prop}', '{val}'], [$prop, $val], $template); |
||
48 | } |
||
49 | |||
50 | return $output; |
||
51 | } |
||
52 | |||
54 |