|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
TomLi Smarty n00b
Joined: 29 Aug 2014 Posts: 1
|
Posted: Fri Aug 29, 2014 6:34 am Post subject: Defined directories |
|
|
Hello all!
I can't find best solution on the www how to set smarty3 directories.
In smarty 2 i have added some lines in Smarty.class.php:
define('TEMPLATES_DIR', 'templates directory path');
define('COMPILE_DIR', 'templates_c directory path');
define('CACHE_DIR', 'cache directory path');
define('CONFIG_DIR', 'configs directory path');
and than in
class Smarty
{
var $template_dir = TEMPLATES_DIR;
var $compile_dir = COMPILE_DIR;
var $config_dir = CONFIG_DIR;
var $cache_dir = CACHE_DIR;
...
}
I wish to know how to set up smarty 3 like this.
Any idea? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Aug 30, 2014 6:10 pm Post subject: |
|
|
See http://www.smarty.net/docs/en/
Use the setter methods like
Code: | $smarty->setTemplateDir = (TEMPLATES_DIR); |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Oct 07, 2014 2:06 pm Post subject: |
|
|
Extend Smarty class and set any options you like in your constructor.
Don't forget to call parent constructor, though. Unless you implement it fully. |
|
Back to top |
|
|
|
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
|