Foros del Web » Programando para Internet » PHP »

Hola mundo Smarty PHP

Estas en el tema de Hola mundo Smarty PHP en el foro de PHP en Foros del Web. El script me envia un error: Cita: Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "templates\index.tpl" on line 1 "{$test}" unknown tag ...
  #1 (permalink)  
Antiguo 27/10/2011, 18:02
Avatar de Algrox  
Fecha de Ingreso: septiembre-2010
Mensajes: 39
Antigüedad: 13 años, 6 meses
Puntos: 1
Exclamación Hola mundo Smarty PHP

El script me envia un error:
Cita:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "templates\index.tpl" on line 1 "{$test}" unknown tag "private_print_expression"' in C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templatecompilerbase.php:617 Stack trace: #0 C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templatecompilerbase.php(402): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "pr...', 1) #1 C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templateparser.php(2331): Smarty_Internal_TemplateCompilerBase->compileTag('private_print_e...', Array, Array) #2 C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templateparser.php(3064): Smarty_Internal_Templateparser->yy_r26() #3 C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templateparser.php(3164): Smarty_Internal_Templateparser->yy_reduce(26) #4 C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ smartytemplatecompiler.php(113): Smarty_Internal_Templateparser->doParse(0, 0) #5 C:\xampp\htdocs\smarty\sysplugins\smarty_inte in C:\xampp\htdocs\smarty\sysplugins\smarty_internal_ templatecompilerbase.php on line 617
Código PHP:
<?php
/* Estancia de Smarty */
define('SMARTY_DIR''/smarty/');
require(
SMARTY_DIR 'Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir 'templates/';
$smarty->compile_dir 'templates_c/';
$smarty->config_dir 'configs/';
$smarty->cache_dir 'cache/';

$smarty->assign('test','Hola mundo');
$smarty->display('index.tpl');
?>
No tengo ni idea de que sea

Si me pudieran ayudar les agradecería demasiado
  #2 (permalink)  
Antiguo 27/10/2011, 20:42
Avatar de andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 12 años, 8 meses
Puntos: 793
Respuesta: Hola mundo Smarty PHP

Syntax Error in template "templates\index.tpl

Muestra el contenido de index.tpl

Saludos.
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:13.