Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | function template() |
||
|
|||
14 | { |
||
15 | $required=$this->column->getNotnull()?'required':''; |
||
16 | |||
17 | $template = str_replace( |
||
18 | [ |
||
19 | '{{columnName}}', |
||
20 | "{{type}}", |
||
21 | "{{required}}", |
||
22 | "{{label}}", |
||
23 | ], |
||
24 | [ |
||
25 | $this->column->getName(), |
||
26 | $this->getType(), |
||
27 | $required, |
||
28 | ucfirst(str_replace('_',' ',$this->column->getName())) |
||
29 | ], |
||
30 | $this->getFormStub('input') |
||
31 | ); |
||
32 | |||
33 | return $template; |
||
34 | } |
||
35 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.