fuel-stats/core/Controller.php

24 lines
454 B
PHP
Raw Permalink Normal View History

<?php
class Controller {
/**
* Redirect to a given URL
*
* @param string $url
*/
public function redirect($url) {
header("Location: $url");
exit();
}
/**
* Render a view
*
* @param string $viewName
* @param array $data
*/
public function view($viewName, $data = [], $layout = "base") {
$view = new View();
$view->render($viewName, $data, $layout);
}
}