| 1 | <?php |
||
| 15 | trait DefaultRenderMethod |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $arguments = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var RenderingContextInterface |
||
| 24 | */ |
||
| 25 | protected $renderingContext; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Forced implementation to build a rendering closure |
||
| 29 | * |
||
| 30 | * @return \Closure |
||
| 31 | */ |
||
| 32 | abstract public function buildRenderChildrenClosure(); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return mixed |
||
| 36 | */ |
||
| 37 | abstract static function renderStatic( |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Default render method to render ViewHelper with |
||
| 45 | * first defined optional argument as content. |
||
| 46 | * |
||
| 47 | * @return string Rendered string |
||
| 48 | * @api |
||
| 49 | */ |
||
| 50 | public function render() |
||
| 58 | } |
||
| 59 |
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.