It is not possible to inherit the parent class and then rewrite its private properties. Without changing its source code, this would require the use of the two interface functions provided by Smarty.
Settemplatedir () and Setcompiledir ()
The configuration is as follows:
Class Mysmarty extends smarty{
publicfunction __construct () {
parent::__construct ();
$this->settemplatedir= './templates ';
$this->setcompiledir= './compile ';
}
}
The source code is as follows:
Private $template _dir = Array ('./templates/');
Private $compile _dir = './templates_c/';
Public Functionsettemplatedir ($template _dir)
{
$this->template_dir = Array ();
foreach ((array) $template _dir as $k + = $v) {
$this->template_dir[$k] = RTrim ($v, '/\\ '). DS;
}
$this->joined_template_dir = Join (' # ', $this->template_dir);
return $this;
}
Public Function Setcompiledir ($compile _dir)
{
$this->compile_dir = RTrim ($compile _dir, '/\\ '). DS;
if (!isset (smarty::$_muted_directories[$this->compile_dir])) {
smarty::$_muted_directories[$this Compile_dir] = null;
}
return $this;
}