View.php 208 B

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