Created
December 17, 2012 22:00
-
-
Save phalcon/4322715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//With the default lifetime | |
$sidebar = $this->viewCache->start("sidebar"); | |
if ($sidebar === null) { | |
echo '<!-- some sidebar code here -->'; | |
$this->viewCache->save(); | |
} else { | |
echo $sidebar; | |
} | |
//Setting a lifetime | |
$sidebar = $this->viewCache->start("sidebar"); | |
if ($sidebar === null) { | |
echo '<!-- some sidebar code here -->'; | |
$this->viewCache->save("sidebar", null, 3600); | |
} else { | |
echo $sidebar; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment