RE: [SMARTY] Smarty 2.2.0 undefined function?
| From: | Jaime Ashander | Date: | Thu, 25 Jul 2002 21:31:18 +0000 |
| Subject: | RE: [SMARTY] Smarty 2.2.0 undefined function? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5455@lists.php.net to get a copy of this message | ||
>The problem in my case was that i had to put
>{include_php file="file:smartyscripts/toplist.php"}
>
>instead of
>
>{include_php file="smartyscripts/toplist.php"}
Isn't that only an issue when you are componentizing your scripts? The
stability of 2.2.0 shouldn't depend on including this.
Strangely enough I just updated my current directory tree via cvs to
full 2.2.0 and somehow it worked. I think there was some parts of old
versions lingering. Here is my directory tree:
C:\
\Inetpub\
\smarty\
\docs\
\mydocs\
\cache\
\templates_c\
\configs\
\misc\
\plugins\
\wwwroot\
\mydocs\
\templates\
index.tpl
myscript.php
mysmarty.inc
then I subclass smarty like this to call it with the correct dirs:
mysmarty.php:
define (SMARTY_DIR,'c:\Inetpub\smarty\\');
require (SMARTY_DIR.'Smarty.class.php');
class My_Smarty extends Smarty {
// boolean variable
var $reload_flag;
// call constructor
function My_Smarty ($reload_fg = false) {
$this->Smarty();
// setup Smarty configs for your app
$this->caching=true;
$this->compile_dir = 'c:\Inetpub\smarty\mydocs\templates_c\\';
$this->config_dir = 'c:\Inetpub\smarty\mydocs\configs\\';
$this->cache_dir = 'c:\Inetpub\smarty\mydocs\cache\\';
}
}
myscript.php:
require_once 'mysmarty.inc';
$smarty = new My_Smarty();
//do stuff
index.tpl:
{* display stuff *}