Welcome Guest, Not a member yet? Register   Sign In
Phil Sturgeon’s Template Library and Codeigniter Caching
#2

[eluser]seonet[/eluser]
[quote author="Aidy" date="1279830062"]I'm trying to get Phil's Template Library to work with Codeigniter caching.

I thought I might be able to just output the template build as a string then load up a view with the string passed in the data array.

Code:
$this->output->cache(42000);
$data['somedata'] = 'Some Data';
$data['loader'] = $this->template->build('view', $data, TRUE);
$this->load->view('loader', $data, FALSE);

Caching does not seem to work with this approach. I've had a look at the template class and can't find anything that I think would effect the caching but some of the code there is probably a bit beyond me. Can anyone tell me why it won't work? Thanks![/quote]

Read the Phil's code.
Code:
/**
     * Set a the cache lifetime
     *
     * @access    public
     * @param    string
     * @param    string
     * @param    boolean
     * @return    void
     */
    public function set_cache($seconds = 0)
    {
        $this->cache_lifetime = $seconds;
        return $this;
    }


Messages In This Thread
Phil Sturgeon’s Template Library and Codeigniter Caching - by El Forum - 04-02-2011, 10:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB