|
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 |
hfugen Smarty n00b
Joined: 12 Dec 2011 Posts: 2 Location: Manila, Philippines
|
Posted: Mon Dec 12, 2011 8:36 am Post subject: Help on using $smarty->plugins_dir |
|
|
Hi,
I'm pretty new in using the Smarty Template Engine. I've tried creating a folder to hold my custom plugins but I keep getting this error message:
"Warning: include(C:\xampp\htdocs\TrainingModule\libs\plugins\function.fetch_fields.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\TrainingModule\templates_c\158e686ed7e075aaf8340fa97de47389a15f4f80.file.editquestion.tpl.php on line 29"
I've already specified the custom plug in folder using this code:
class Administrator extends Smarty {
public function __construct()
{
parent::__construct();
$this->plugins_dir[] = 'includes/customplugins';
}
} |
|
Back to top |
|
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Mon Dec 12, 2011 9:10 am Post subject: Your case is different |
|
|
I have seen such errors very rarely due to own mistakes. It is probably not related with your settings, but something with that - compiled php files are not available.
Your template file - file.editquestion.tpl.php was not compiled properly or deleted by some means. And the system did not recompile the file again. If you remember, it was working in the past, you can try deleting files in C:\xampp\htdocs\TrainingModule\templates_c\.
Thus, smarty would recompile correctly.
But your case might be sometimes different. Do not delete them permanently. Rather keep the backup before you go.
If you downloaded those files from your client's ftp server, try to download all those compiled template files as well, so you do not have warnings on include().
After all, your compiled files are missing. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Dec 12, 2011 4:29 pm Post subject: |
|
|
You must use also the setter methods when modifying the directory settings.
Code: | class Administrator extends Smarty {
public function __construct()
{
parent::__construct();
$this->addPluginsDir = 'includes/customplugins';
}
} |
|
|
Back to top |
|
hfugen Smarty n00b
Joined: 12 Dec 2011 Posts: 2 Location: Manila, Philippines
|
Posted: Wed Dec 14, 2011 1:07 pm Post subject: |
|
|
Hi, guys:
Thank you very much for your replies. I've finally got it to work. |
|
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
|