Welcome Guest, Not a member yet? Register   Sign In
Avoiding form elements caching ???
#1

[eluser]veledrom[/eluser]
Hi,

I know that $this->output->cache(n); caches everything in the page. Is there anything I can do to avoid form elements being cached because they are unique for every users?

Thanks
#2

[eluser]Aken[/eluser]
I wouldn't cache the form part of the page, since things like validation and form repopulating are difficult with a cached form.
#3

[eluser]veledrom[/eluser]
That's what I am asking. How do I avoid it???
#4

[eluser]John_Betong_002[/eluser]
Try this:

Code:
# I am not sure of the count() value, you will have to check
if( ! isset( $_POST ) && count( $_POST ) < 2 )
{
  $this->output->cache(n);
}
&nbsp;
&nbsp;
#5

[eluser]veledrom[/eluser]
Yes but it avoids caching whole page if there is a POST data!

Let me start again: I want to cache everything in a webpage <b>apart from</b> its form elements.
#6

[eluser]John_Betong_002[/eluser]
&nbsp;
Try a Google search on "Phil Sturgeon partial cache"
&nbsp;
&nbsp;
edit: spelling




Theme © iAndrew 2016 - Forum software by © MyBB