Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{include} and include_path

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Mon Jun 21, 2004 4:55 am    Post subject: {include} and include_path Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jun 21, 2004 7:20 am    Post subject: Re: {include} and include_path Reply with quote

gerard wrote:
Should {include} be able to use php's include_path?


I think it should not.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Wed Dec 29, 2004 8:12 am    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Dec 29, 2004 11:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Wed Dec 29, 2004 8:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Dec 29, 2004 8:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Thu Dec 30, 2004 11:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP