Skip to content

Instantly share code, notes, and snippets.

@mickaelandrieu
Last active December 18, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickaelandrieu/5790156 to your computer and use it in GitHub Desktop.
Save mickaelandrieu/5790156 to your computer and use it in GitHub Desktop.
Because Twig miss me a lot :(
<?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