View.class.php 238 B

1234567891011
  1. <?php
  2. class View {
  3. public function render($viewName, array $viewData) {
  4. ob_start();
  5. extract($viewData, EXTR_OVERWRITE);
  6. include(ROOT_PATH . "/views/" . $viewName);
  7. $view = ob_get_contents();
  8. ob_end_clean();
  9. return $view;
  10. }
  11. }