RSS

smarty caching problem

31 Mar

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);
}

Advertisements
 
1 Comment

Posted by on March 31, 2008 in Uncategorized

 

Tags:

One response to “smarty caching problem

  1. ada

    September 16, 2009 at 11:52 am

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: