Ahora me marca otro tipo de error:
<?
require_once RUTA_lib_smarty.'Smarty.class.php';
$smarty = new Smarty;
function do_translation($params, $content, &$smarty, &$repeat)
{
if($params["lang"] == "translate")
{
require_once RUTA_lib.'Translate.php';
// frease Regístrate a pasar
$translate = new valor_translate($params['lang']);
}
// retornar la variable $translate al valor Regístrate
return $translate;
}
$smarty->registerPlugin("function", "translate", "do_translation");
?>
Código HTML:
{translate lang="translate"}Regístrate{/translate}
ERROR:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\xampp\htdocs\Comercios_electronicos_1\mer ca\templates\cabecera_registrate.html" on line 6 "" unknown tag "translate"' in C:\xampp\htdocs\Comercios_electronicos_1\merca\app \lib\smarty\libs\sysplugins\smarty_internal_templa tecompilerbase.php:657 Stack trace: #0 C:\xampp\htdocs\Comercios_electronicos_1\merc\app\ lib\smarty\libs\sysplugins\smarty_internal_templat ecompilerbase.php(443): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "tr...', 6) #1 C:\xampp\htdocs\Comercios_electronicos_1\merca\app \lib\smarty\libs\sysplugins\smarty_internal_templa teparser.php(2388): Smarty_Internal_TemplateCompilerBase->compileTag('translate', Array) #2 C:\xampp\htdocs\Comercios_electronicos_1\merca\app \lib\smarty\libs\sysplugins\smarty_internal_templa teparser.php(3101): Smarty_Internal_Templateparser->yy_r36() #3 C:\xampp\htdocs\Comercios_electronicos_1\merc in C:\xampp\htdocs\Comercios_electronicos_1\merca\app \lib\smarty\libs\sysplugins\smarty_internal_templa tecompilerbase.php on line 657