Smarty Static Path?

Go To StackoverFlow.com

0

How to specify the static content in Smarty? I have many zip attachement for users to download. How do I specify the filepath in Smarty?

DOMAIN_NAME/static/x.zip or ?

2012-04-04 07:30
by jebberwocky


0

If your webapp is available at http://example.com and your zip files are stored in the static folder, at the same level of your webapp root then just:

<h1>Downloads</h1>
{foreach $zips as $zip}
    <a href="/static/{$zip}">{$zip}</a>
{/foreach}

If the zip files are outside the web root then you either move them there or make a symlink.

2012-04-04 09:08
by noisebleed
thanks! a quick question: will smarty use the module "static" if I access the path example.com/static/a.pdf - jebberwocky 2012-04-05 02:46
If you want a url instead of a absolute or relative path use href="http://example.com/path/to/file.pdf". Not sure what you mean by "module" - noisebleed 2012-04-05 08:53
Ads