SV: [SMARTY] cannot get smarty working
| From: | Paolo Nesti Poggi | Date: | Mon, 30 Sep 2002 11:09:49 +0000 |
| Subject: | SV: [SMARTY] cannot get smarty working | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6047@lists.php.net to get a copy of this message | ||
Required files get required either as specified by an absolute path or
relative to your include directory as it is specified in your php.ini file.
In your structure you write "document root", but what is relevant to know is
if it is the server root (it shouldn't be for safety reasons) or if it is
your system root (eg. C: or similar). Then look into your php.ini file to
see your include directory. If it is for instance "c:/includes/" you don't
need to
define('SMARTY_DIR','includes/');
Try writing
print ($smarty->template_dir);
just before
require(SMARTY_DIR.'Smarty.class.php');
Than you will se where php is looking for your template and you probably
also understand why it cant find it.
Paolo
> -----Oprindelig meddelelse-----
> Fra: Will [mailto:willa2@hotmail.com]
> Sendt: 30. september 2002 12:30
> Til: smarty-general@lists.php.net
> Emne: [SMARTY] cannot get smarty working
>
>
> I just tried to get smarty working but I can't get it to. I'm
> running Apache on a windows 98 local machine (For testing
> websites) and I tried installing smarty using the example system
> and all I got was "Cant read resource index.tpl". This is the structure.
>
> Document Root
> |--guestbook
> |--includes
> --Config_File.class.php
> --debug.tpl
> --Smarty.class.php
> --Smarty_Compiler.class.php
> |--cache
> |--configs
> |--templates_c
> |--templates
> --index.tpl
> --index.php
>
> Contents of index.tpl:
> <HTML>
> <TITLE>Hello</TITLE>
> <BODY>
> Hello, {$Name}!
> </BODY>
> </HTML>
>
> Contents of index.php:
> <?php
> define('SMARTY_DIR','includes/');
> require(SMARTY_DIR.'Smarty.class.php');
> $smarty = new Smarty;
> $smarty->assign('name','Ned');
> $smarty->display('index.tpl');
> ?>
>
> What am I doing wrong??????
>
> Willa
>