<?php

/**
 * Return the path to a view file.
 */
function template($name)
{
	return SRC . "/../templates/$name.php";
}

/**
 * Render a view with the given data. Looks for `$view` through `template()`.
 */
function render($pathToBaseView, $data = [])
{
	ob_start();
	extract($data);
	require template($pathToBaseView);
	return ob_get_clean();
}
