-
-
Save Golpha/da55b86c9d7c811a3074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function parseTemplate($template, array $variables = [], array &$throwBacks = array()) | |
{ | |
$scope = function() use ($variables, $template, &$throwBacks) | |
{ | |
extract($variables); | |
ob_start(); | |
$throwBacks = include sprintf('%s/static/%s', __DIR__, $template); | |
if ( ! is_array($throwBacks) ) | |
{ | |
$throwBacks = (array) $throwBacks; | |
} | |
$content = ob_get_clean(); | |
return $content; | |
}; | |
return $scope(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
navigation.html -> get_defined_vars()