Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/08/2014, 05:32
logitek4356
 
Fecha de Ingreso: agosto-2014
Mensajes: 5
Antigüedad: 9 años, 8 meses
Puntos: 0
Respuesta: dudas principiante smarty php

lo he resuelto con este codigo desde el php que genera la lista de platos

Código PHP:
<?php
error_reporting
(E_ALL E_DEPRECATED);

require(
'../libs/Smarty.class.php');
require (
'../php/conexion.php');


$smarty = new Smarty;
$smarty->compile_check true;
$smarty->debugging false;
$smarty->use_sub_dirs false;

 
$sql 'SELECT * ';
$sql .= 'FROM `posts` ';
$sql .= 'ORDER BY `id` DESC LIMIT 0, 5'
  
$result mysql_query($sql) or die("Query failed: ".mysql_error());

while (
$line mysql_fetch_assoc($result))
{
    
$value[] = $line
    
$smarty->assign('posts'$value);
}
$smarty->display('../templates/header.tpl');

$smarty->display('../templates/recetas.tpl');

$smarty->display('../templates/footer.tpl');
  
?>
y asi es como queda, pero dudo que smarty se use asi, si me pudieran indicar que estoy haciendo mal se lo agradeceria