Re: [SMARTY] Paths in templates
| From: | Ferdinand Beyer | Date: | Mon, 03 Feb 2003 15:28:32 +0000 |
| Subject: | Re: [SMARTY] Paths in templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7476@lists.php.net to get a copy of this message | ||
On 3 Feb 2003 at 1:45, gawan wrote:
> I have my php scripts in the web root folder and
> both images and templates one level lower
>
> ROOT (.php scripts)
> |__ /images
> |__ /templates
>
> Now if I have to include an image in my template,
> Smarty seems to accept both these forms:
Smarty doesn't accept anything - it will only pass the html tags right
to the client without modifying them.
>
> <img href="../pics/....
> and
> <img href="pics/....
>
> This is amazing, which would be most correct?
> Am I writing templates as if they were in my php
> or as they were independent files with a location?
The client does not notice where you're templates are - it will
normally not even notice that you are actually using templates.
So reference your images just as you would reference them in the
executed php script, e.g. if your php script /home/index.php is called,
your images recide in /images folder and your template is
/smarty/templates/home/main.tpl, you'll have to reference images by
"/images/example.gif" or "../images/example.gif".
--
Ferdinand Beyer
<fbeyer@clickhand.de>