View previous topic :: View next topic |
Author |
Message |
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Mon Jun 21, 2004 4:55 am Post subject: {include} and include_path |
|
|
Should {include} be able to use php's include_path? Since upgrading from 2.6.2, it's not working {include file="dir_in_include_path/smarty_template.html"}.
Quote: | Warning: Smarty error: unable to read resource: "dir_in_include_path/smarty_template.html" in Smarty-2.6.3/Smarty.class.php on line 1084 |
I've tried clearing my compiled templates as well. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Jun 21, 2004 7:20 am Post subject: Re: {include} and include_path |
|
|
gerard wrote: | Should {include} be able to use php's include_path? |
I think it should not. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Wed Dec 29, 2004 8:12 am Post subject: |
|
|
What does this mean then?
Quote: | Smarty now correctly respects the PHP include_path for $template_dir, $compile_dir, $cache_dir, $config_dir and $plugin_dir. Be aware that relying on the include_path is an overhead, try to use absolute pathnames when possible (or relative to working directory.) |
http://smarty.php.net/misc/RELEASE_NOTES |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Dec 29, 2004 11:11 am Post subject: |
|
|
it means that smarty uses include_path to search for $smarty->template_dir, if $smarty->template_dir is a relative path. don't mix that up with using include_path to search for templates. smarty doesn't do the latter. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Wed Dec 29, 2004 8:05 pm Post subject: |
|
|
Can $template_dir take an array (I thought I remember seeing somewhere that it could, but the docs don't say)? If so, if smarty can't find one of the dirs in cwd then will it try include_path? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Dec 29, 2004 8:53 pm Post subject: |
|
|
gerard wrote: | Can $template_dir take an array (I thought I remember seeing somewhere that it could, but the docs don't say)? |
yes, that works quite well. but it's not officially supported, that's why it is not documented.
Quote: | If so, if smarty can't find one of the dirs in cwd then will it try include_path? |
i don't see the connection of this question to the first question of this post, but yes, that's they way how smarty searchs for $template_dir. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Thu Dec 30, 2004 11:26 am Post subject: |
|
|
Are you guys going to officially support $template_dir arrays and utilizing include_path, or is there a danger they'll be removed? |
|
Back to top |
|
|