Get Smarty

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

Postfilters

Los postfilters de template son funciones de PHP con las cuales sus templates son corridos inmediatamente después de ser compilados. Los postfilters pueden ser registrado o cargados del directorio de plugins usando la función load_filter() o por la variable de configuración $autoload_filters. El Smarty pasara el código fuente del template compilado como el primer argumento, y espera que la función retorne el resultado del procesamiento.

Example 15.3. Usando un postfilter de template


<?php
// ponga esto en su aplicaci&oacute;n
function add_header_comment($tpl_source, &$smarty)
{
    return "<?php echo \"<!-- Created by Smarty! -->;\n\" ?>;\n".$tpl_source;
}

// registra el postfilter
$smarty->register_postfilter("add_header_comment");
$smarty->display("index.tpl");
?>

Observe como hacer la compilacion para Smarty del template index.tpl:

     
     <!-- Created by Smarty! -->
     {* rest of template content... *}
     
       

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 8 plus 15? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk