Re: [SMARTY] install issue
| From: | Bill Angus | Date: | Sun, 18 May 2003 05:12:44 +0000 |
| Subject: | Re: [SMARTY] install issue | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9573@lists.php.net to get a copy of this message | ||
You fixed it Messju !!Thanks!!
$smarty->display('index.tpl'); // works -- the other way does not work in my
environment.
Bill Angus
http://www.psychtest.com
----- Original Message -----
From: messju mohr
To: Bill Angus
Cc: smarty-general@lists.php.net
Sent: Saturday, May 17, 2003 2:53 PM
Subject: Re: [SMARTY] install issue
On Sat, May 17, 2003 at 02:03:55PM -0700, Bill Angus wrote:
> oops I was totally wrong.
>
> The thing compiles with the "file." addition suggested by Messju. It runs without
> throwing an error -- but no output of the contents of the template happens. A problem with the
> former files was that I had a template index.tp1 (tp-one) instead of index tpl (tp-ell)
>
> Currently, the processing of template file seems to work fine up to a point -- at least I
> traced it through ok with the debugger. The template file gets parsed but only a TRUE gets returned
> after the template is processed, instead of the actual display of the template file taking place.
>
> -----------------
> //here is current .php file configuration
>
> <?PHP
> define('SMARTY_DIR','C:\\PHP\\Smarty\\libs\\');
> define('Project_DIR','E:\\Tester\\');
> require(SMARTY_DIR.'Smarty.class.php');
> $smarty = new Smarty;
> $smarty->template_dir =Project_DIR.'templates\\';
> $smarty->compile_dir = Project_DIR.'templates_c\\';
> $smarty->config_dir = Project_DIR.'configs\\';
> $smarty->cache_dir = Project_DIR.'cache\\';
> $smarty->assign('name','BillAngus');
> $smarty->display('file:'.$smarty->template_dir.'index.tpl');
arg, a little correction! i was thinking a bit too far here.
although this:
$smarty->display('file:'.$smarty->template_dir.'index.tpl');
should work,
this:
$smarty->display('index.tpl');
is much easier.
since you configured your template_dir properly, you don't have to
provide a full path to the template, you just need the template's path
relative to $smarty->template_dir. this also saves problems with the
'C:' being a resource-name.
> ?>
> ---------------------------
> // here is the file index.tpl.php which comes out of the process
>
> <?php /* Smarty version 2.5.0, created on 2003-05-17 12:34:27
> compiled from file:E:\Tester\templates\index.tpl */ ?>
>
> ----------------------------
yes, this looks buggy. you say you use apache-2.0.44 on windows. i
don't have a testing environment for that webserver and i have no idea why the
rest of the template (sth. like:
"Hello, <?php echo $this->_tpl_vars['name']; ?>") isn't written.
sorry.
> // here is the index.tpl file
>
> {* Smarty *}
>
> Hello, {$name}!
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php