src/Controller.php 1 location
|
@@ 339-348 (lines=10) @@
|
| 336 |
|
* @param array $data |
| 337 |
|
* @return string $html, view contents |
| 338 |
|
*/ |
| 339 |
|
public function getView($viewName, $data = null, $templateRootFolder = null) |
| 340 |
|
{ |
| 341 |
|
$view = new \erdiko\core\View($viewName, $data); |
| 342 |
|
|
| 343 |
|
if ($templateRootFolder != null) { |
| 344 |
|
$view->setTemplateRootFolder($templateRootFolder); |
| 345 |
|
} |
| 346 |
|
|
| 347 |
|
return $view; |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
/** |
| 351 |
|
* Add a view from the current theme with the given data |
src/Helper.php 1 location
|
@@ 42-50 (lines=9) @@
|
| 39 |
|
* @param string $viewName |
| 40 |
|
* @param array $data |
| 41 |
|
*/ |
| 42 |
|
public static function getView($viewName, $data = null, $templateRootFolder = null) |
| 43 |
|
{ |
| 44 |
|
$view = new \erdiko\core\View($viewName, $data); |
| 45 |
|
|
| 46 |
|
if ($templateRootFolder !== null) { |
| 47 |
|
$view->setTemplateRootFolder($templateRootFolder); |
| 48 |
|
} |
| 49 |
|
return $view->toHtml(); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
/** |
| 53 |
|
* Read JSON config file and return array |