Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/03/2015, 12:58
Avatar de Chiiviito
Chiiviito
 
Fecha de Ingreso: octubre-2012
Mensajes: 64
Antigüedad: 11 años, 6 meses
Puntos: 0
Respuesta: Necesito saber como ejecutar funcion desde TWIG

No logro ahcerlo funcionar asi yo tengo mi codigo, mi index:

Código PHP:
/*-- Esta es mi funcion --*/
function TestFuncion($var,$var2)
{
    
$allvar    =    $var.$var2;
    return 
$allvar;
}
/*-----*/
require_once 'Twig/Autoloader.php';

Twig_Autoloader::register();

$loader = new Twig_Loader_Filesystem('templates');

$twig = new Twig_Environment($loader, array(
            
'cache' => 'cache',
            
'debug' => 'true'));
            
$template $twig->loadTemplate('index.twig.html');

echo 
$template->render(array(
)); 
Como tendria que quedar?