Last active
December 18, 2015 13:29
-
-
Save mickaelandrieu/5790156 to your computer and use it in GitHub Desktop.
Because Twig miss me a lot :(
This file contains hidden or 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 emulateTwigTemplating(&$fullString, $params) | |
{ | |
foreach($params as $paramKey => $param){ | |
$fullString = str_replace("$paramKey", $param, $fullString); | |
} | |
return $fullString; | |
} | |
$panelView = file_get_contents($filename); | |
$html = emulateTwigTemplating($panelView, array('%config_option%' => $config_option)); | |
echo $html; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment