Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2014, 12:23
manelmanel8
 
Fecha de Ingreso: marzo-2012
Mensajes: 180
Antigüedad: 12 años, 2 meses
Puntos: 2
Smarty utilizar una clase externa

Tengo un archivo que tengo funciones realizadas por mi y me gustaria utilizarlas en smarty, entonces hice lo siguiente.

header.php

Código PHP:
<?php
require_once 'smarty.init.php';
require_once 
'class/Functions.php';

$function = new Functions;
$function->getMenu;

$smarty->assign('menu',$function);

$smarty->display('header.tpl');
header.tpl

Código PHP:
    <nav>   
        <
ul>
            {
$function}
        </
ul>
    </
nav
Me carga todo menos la funcion que me sale estos errores.

Cita:
otice: Undefined index: function in C:\xampp\htdocs\wensfilmsmarty\templates_c\20a5b87 bf1d249a8e4b5bdf6dc560aa9c65c681a.file.header.tpl. cache.php on line 37

Notice: Trying to get property of non-object in C:\xampp\htdocs\wensfilmsmarty\templates_c\20a5b87 bf1d249a8e4b5bdf6dc560aa9c65c681a.file.header.tpl. cache.php on line 37