| Total Complexity | 6 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class View extends ViewBase |
||
| 20 | { |
||
| 21 | |||
| 22 | /** |
||
| 23 | * View's name |
||
| 24 | * |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $viewName = ''; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Constructor |
||
| 31 | * |
||
| 32 | * @param HtmlTemplate $template |
||
| 33 | * template |
||
| 34 | * @param string $viewName |
||
| 35 | * View name to be rendered |
||
| 36 | */ |
||
| 37 | public function __construct(HtmlTemplate $template = null, string $viewName = '') |
||
| 38 | { |
||
| 39 | parent::__construct($template); |
||
| 40 | |||
| 41 | $this->viewName = $viewName; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Method renders content from view |
||
| 46 | * |
||
| 47 | * @param string $viewName |
||
| 48 | * View name to be rendered |
||
| 49 | * @return string Generated content |
||
| 50 | */ |
||
| 51 | public function render(string $viewName = ''): string |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Method returns view name |
||
| 73 | * |
||
| 74 | * @return string view name |
||
| 75 | */ |
||
| 76 | public function getViewName(): string |
||
| 79 | } |
||
| 80 | } |
||
| 81 |