SitePoint Sponsor |
|
User Tag List
Results 1 to 1 of 1
-
Feb 28, 2009, 02:45 #1
- Join Date
- Jan 2009
- Location
- Konoha Fire Country
- Posts
- 311
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Question on SMARTY CACHE and COMPILE
hi,
I have a question because now I'm really confused.
I have 3 templates w/c are header.tpl, footer.tpl and body.tpl..
I cached header.tpl and footer.tpl. And it was ok. The two files were cached.
But when I try to edit the body.tpl it doesn't seem to update, eventhough its not cached..
Can anyone help me here..
If I edit a cached template will it also automatically updated the cached one???
here's my code
Code:class Skemma { public function Header() { $smarty = new Smartysetup(); $smarty->caching = true; return $smarty->fetch('header.tpl'); } public function Footer() { $smarty = new Smartysetup(); $smarty->caching = true; return $smarty->fetch('footer.tpl'); } }
Code:class HomeClass { private $skemm; public function Display() { $smarty = new Smartysetup(); $this->skemm = new Skemma(); $smarty->assign('header',$this->skemm->Header()); $smarty->assign('footer',$this->skemm->Footer()); $smarty->caching = false; $smarty->assign('body',$smarty->fetch('body.tpl')); $smarty->display('main_skemma.tpl'); } }
Uniquely FILIPINO... See how talented and creative Filipinos are.
http://www.smalltym.com
Custom Web Designs: http://proweaver.com
Bookmarks