|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kleinerChemiker Smarty Rookie
Joined: 12 Dec 2003 Posts: 28
|
Posted: Fri Dec 10, 2004 8:05 pm Post subject: problem with compile_dir |
|
|
index.php
Code: |
<?php
ini_set('include_path', ".:/home/.sites/137/site42/web/includes:./includes");
include('setup.php');
$header = new Smarty;
$header->debugging = true;
#$header->compile_dir = '/home/.sites/137/site42/web/infow/includes/templates_c/';
$header->assign("titel", "Oldworld's InfoSeite");
$header->display('index.tpl');
?>
|
setup.php
Code: |
<?php
include('smarty/Smarty.class.php');
class Smarty_GuestBook extends Smarty {
function Smarty_GuestBook() {
$this->Smarty();
$this->template_dir = '/home/.sites/137/site42/web/infow/includes/templates/';
$this->compile_dir = '/home/.sites/137/site42/web/infow/includes/templates_c/';
#$this->config_dir = '/home/.sites/137/site42/web/infow/includes/configs/';
#$this->cache_dir = '/home/.sites/137/site42/web/infow/includes/cache/';
}
}
?>
|
ok, here my problem: $this->compile_dir in setup.php doesnt work. only if i add the line $header->compile_dir in index.php the skript works and compiles without error. the error is:
Quote: |
Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory. in /home/.sites/137/site42/web/includes/smarty/Smarty.class.php on line 1088
|
any idea, why?
tia
MIK |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Dec 10, 2004 9:45 pm Post subject: |
|
|
Because you aren't instancing your extended class. Like this:
$header = new GuestBook_Smarty; |
|
Back to top |
|
kleinerChemiker Smarty Rookie
Joined: 12 Dec 2003 Posts: 28
|
Posted: Fri Dec 10, 2004 9:51 pm Post subject: |
|
|
thx, solved the problem
but why does smarty find the template-dir? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Dec 10, 2004 10:11 pm Post subject: |
|
|
kleinerChemiker wrote: | thx, solved the problem
but why does smarty find the template-dir? |
It is doubtful that it does, though it could be coincidental. Perhaps you had a copy of your template in the Smarty/template dir or perhaps you have a slightly older version of Smarty that searched for the template dir the include path and your template dir happened to be in the include path? |
|
Back to top |
|
kleinerChemiker Smarty Rookie
Joined: 12 Dec 2003 Posts: 28
|
Posted: Sat Dec 11, 2004 1:39 pm Post subject: |
|
|
no, the templates is only in de template dir and its the most uptodate version of smarty. (downloaded ist yesterday)
MIK
i've had this problem once before, but unsolved and dont need smarty for a long time. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|