You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
World Wide Web Server edited this page Jul 4, 2012
·
7 revisions
At this time, CodeIgniter (1.3.2) does not support fragment caching. To overcome this limitation, here is technique that can be used in the event that you do need a fragment caching feature.
This technique involves breaking out a fragment into its own method, and from within the main view, referencing the URL of the fragment with a [b]require()[/b] statement.
[b]controllers/fragment.php[/b]
[code]
class Fragment Extends Controller {
function Fragment() {
parent::Controller();
}
function index() {
$data['current_time'] = date('U');
$this->load->view('time_view',$data);
}
function cached_time() {
$this->output->cache(10);
$data['cached_time'] = date('U');
$this->load->view('cached_time_view',$data);
}
}