Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function renderTemplate($filePath, $variables = []) {
- if (!is_array($variables)) {
- throw new Exception('Variables var must be of type array, ' . gettype($variables) . ' given');
- }
- extract($variables);
- ob_start();
- require $filePath;
- return ob_get_clean();
- }
Add Comment
Please, Sign In to add comment