Suggestion/Comments - Caching Assigned Data

From: Date: Wed, 29 May 2002 21:31:26 +0000
Subject: Suggestion/Comments - Caching Assigned Data
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4436@lists.php.net to get a copy of this message
Heya, What you think about the idea of caching Assigned Data instead like Templates? Example: $smarty->assign_caching = true; if(!$smarty->is_assign_cached("Content Listing",CACHE_ID)) { // do database calls generate $content_listing here } $smarty->assign("Content Listing",$content_listing,CACHE_ID); if(!$smarty->is_assign_cached("Article",CACHE_ID)) { // do database calls generate $article here } $smarty->assign("Article",$article ,CACHE_ID); $smarty->display("index.tpl"); Saves from having multiple templates like(header.tpl, categories.tpl, subcategories.tpl, content.tpl, footer.tpl) and only having a plain text editor to edit them cause having a template separated into different files creates broken 'open' and 'close' tags. Having all of those inside 'index.tpl' and doing 'assign_caching' instead and making it easier to edit with a WYSIWYG program like Dreamweaver because all the tags would be in the same file. Hope this makes sense... WiL Laxa BlenderMedia

« previous php.smarty.general (#4436) next »