Created
December 19, 2013 11:22
-
-
Save pabloprogramador/8037770 to your computer and use it in GitHub Desktop.
Mustache
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 | |
$vars = array( | |
'cumprimento' => $this->_saudacao(), | |
'cliente' => $cliente->NOME_CLIENTE, | |
'tratamento' => $cliente->SEXO ? 'Senhora' : 'Senhor', | |
'atendente' => $_SESSION['nomeUsuario'], | |
'botao_financeiro' => '<a href="#?keepThis=true&TB_iframe=true&height=400&width=700" class="botao thickbox">Verificar Valores</a>' | |
); | |
$mustache = function ($valor,$vars){ | |
return preg_replace_callback('/{{\s*(\w+)\s*}}/', function (array $m) use ($vars) { | |
return $vars[$m[1]]; | |
}, $valor);}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment