smarty caching problem

we can use {dynamic} for blocking perticular section of page to cache!

[index.php]

$smarty = new Smarty;
smarty->caching = true;

function smarty_block_dynamic($param, $content, &$smarty) {
return $content;
}
$smarty->register_block(‘dynamic’, ’smarty_block_dynamic’, false);

[index.tpl]

{dynamic}

{insertx name=photo_link assign=plink pid=$smarty.section.san.index}
{$plink}

{/dynamic}

here the section photo_link will not cached it is the dynamic block.

“insertx” is the plugin for insert tag used in smarty template files

function smarty_function_insertx($params, &$smarty)
{

$func=”insert_”.$params['name'];

if($params['assign']!=”")
$smarty->assign($params['assign'], $func($params));
else
return $func($params);
}

1 comment so far

  1. ada on

    Technology used

    Programming Language, Databases, App Servers

    Web Servers

    Scripting

    Development environment

    Test environment

    Services Oriented Architecture

    Development & Testing

    Tools and processes, Communication, Defect Resolution Monitoring & Tracking, Checkpoints, Quality Reviews, Change Controls


Leave a reply