Yes, you're right, there's a Smarty forum also, but there are not so many PHP programmers posting there. 🙂
Instead of posting a lot of code, I better try to explain the issue.
I have a class with some basic methods (like getting some information from database and stuff like that) that I want to extend with Smarty:
MYCLASS.PHP
Class MyClass extends Smarty {
// ... some vars definition here ...
// Constructor.
function MyClass()
{
$this->Smarty();
$this->template_dir = 'templates/';
$this->compile_dir = 'templates_c/';
$this->config_dir = 'configs/';
$this->cache_dir = 'cache/';
$this->caching = true;
//+ some DB conection
}
// other methods here ....
}//end of class
Then I have a PHP file where I initiate the class and display some records from database.
INDEX.PHP
require("myclass.php");
$obj = new MyClass();
// dummy example:
// here, depending on what is the value of a get variable
// I get something from database
// so the value of $some is dynamic, it changes depending of GET input
$some = $obj->SomeMethod($_GET['query']);
// assign it to some var template
$obj->assign("some", $some);
// and display the template
$obj->display("template.tpl");
Now, when I run this script first time(and pass a GET e.g. ?query=default), Smarty looks like it's working fine, it caches the script and displays the template like it should.
But when I pass a new GET variable (e.g. ?query=newstuff), Smarty displays the old cached content that was previously displayed (with ?query=default).
I hope this description is enough to give you some idea of what's happening with my code, and maybe can figure out why this is happening.
I noticed that if I disable the caching it works, but only on my local windows server, and not on linux (RHEL AS), on which it does not work at all. (doens't display anything, just blank page with no errors). So this is not a solution.
PS: I'm using the latest version of smarty.
Thanks for trying to help me with this. 🙂
Cheers,
Daniel