how do we include style sheets from a template file in smarty?
ca we use a relative path or does it have to be n absolute path?
structure might look like
project
|-- library
|-- css
|-- style.css
|--template
|--index.tpl
|--template_c
in the index.tpl what would be the proper format to access style.css?
would it ../library/css/style.css? or
/project/library/css/style.css?
It depends on what you want to do.
If your goal is to have the browser access the css file, you need to specify the path relative to the document root. so, if your project lies within htdocs, it might be
/project/library/css/style.css.If your goal is to read the CSS within Smarty (say to inline it) you need to specify the absolute file path (e.g.
/home/users/foo/project/library/css/style.css)Accessing files relative to the current template file works with ./file and ../file – but only for {include} and {extends}. Everything else must either be absolute or relative to the CWD (current working directory) of the actually executed script.