-function placeholder_include($name, $params = [])
-{
- $path = stream_resolve_include_path("$name.php");
- if (!file_exists($path)) {
- return '<strong class="warn"><em>'.$name.'</em> ontbreekt</strong>';
- }
-
- ob_start();
- $Page = $GLOBALS['Page'] . $GLOBALS['Args'];
- $Args = '';
- $Place = $GLOBALS['Place'];
- foreach ($params as $param) {
- if ($set = strpos($param, '=')) {
- $Place[ substr($param, 0, $set) ] = substr($param, $set + 1);
- }
- elseif (!empty($param)) {
- $Args .= '/'.$param;
- }
- }
- try {
- include "$name.php";
- return ob_get_clean();
- }
- catch (Exception $e) {
- return sprintf('<strong class="warn">%s</strong>',
- "fout in <em>$name</em>: {$e->getMessage()}"
- );
- }
-}
-