| 1 | <?php |
||
| 16 | abstract class AbstractViewHelper |
||
| 17 | { |
||
| 18 | |||
| 19 | /** @var ViewController */ |
||
| 20 | protected $view; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Render a view with given template and variables |
||
| 24 | * |
||
| 25 | * @param string $template |
||
| 26 | * @param array $variables |
||
| 27 | * |
||
| 28 | * @return string |
||
| 29 | * |
||
| 30 | * @throws ServiceNotFoundException |
||
| 31 | * @throws FileNotFoundException |
||
| 32 | */ |
||
| 33 | protected function renderView($template = '', array $variables = []) :string |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param ViewController $view |
||
| 45 | */ |
||
| 46 | public function setView(ViewController $view) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return ViewController |
||
| 53 | */ |
||
| 54 | public function getView() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get instance of service locator |
||
| 61 | * |
||
| 62 | * @return ServiceLocator |
||
| 63 | */ |
||
| 64 | public function getServiceLocator() :ServiceLocator |
||
| 68 | |||
| 69 | } |