Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Help on using $smarty->plugins_dir

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
hfugen
Smarty n00b


Joined: 12 Dec 2011
Posts: 2
Location: Manila, Philippines

PostPosted: Mon Dec 12, 2011 8:36 am    Post subject: Help on using $smarty->plugins_dir Reply with quote

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
View user's profile Send private message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Mon Dec 12, 2011 9:10 am    Post subject: Your case is different Reply with quote

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
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Dec 12, 2011 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
hfugen
Smarty n00b


Joined: 12 Dec 2011
Posts: 2
Location: Manila, Philippines

PostPosted: Wed Dec 14, 2011 1:07 pm    Post subject: Reply with quote

Hi, guys:

Thank you very much for your replies. I've finally got it to work. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins 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