RE: [SMARTY] Paths in templates
| From: | SavaJr | Date: | Mon, 03 Feb 2003 15:41:41 +0000 |
| Subject: | RE: [SMARTY] Paths in templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7477@lists.php.net to get a copy of this message | ||
On unix you can also make symlinks in templates dir, to original dirs.
Like
Templates
- img -> ../img/
It helps while developing
---------------
Ruslan Savchyshyn
http://www.MagneticOne.com/
Web development and design services
-----Original Message-----
From: Ferdinand Beyer [mailto:fbeyer@clickhand.de]
Sent: Monday, February 03, 2003 5:29 PM
To: gawan
Cc: smarty-general@lists.php.net
Subject: Re: [SMARTY] Paths in templates
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>
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php