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

Application::$plugins_dir has no effect

 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
ivica
Smarty Rookie


Joined: 11 Jul 2016
Posts: 6

PostPosted: Tue Jul 12, 2016 8:40 pm    Post subject: Application::$plugins_dir has no effect Reply with quote

Smarty 3.1.29

I've tried:

$this->setPluginsDir(SMARTY_DIR . 'plugins')
->addPluginsDir(SMARTY_DIR . 'smarty_plugins');

and

$this->plugins_dir[0] = SMARTY_DIR . 'plugins';
$this->plugins_dir[1] = SMARTY_DIR . 'smarty_plugins';

and always I have had this error:

ERRNO: 8
TEXT: Indirect modification of overloaded property Application::$plugins_dir has no effect
LOCATION: C:\xampp\htdocs\tshirtshop4\presentation\application.php, line 39, at July 12, 2016, 10:36 pm
Showing backtrace:
Application.__construct() # line 16, file: C:\xampp\htdocs\tshirtshop4\index.php


Three days already trying.

Thank you in advance!
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1568

PostPosted: Tue Jul 12, 2016 9:14 pm    Post subject: Reply with quote

Nobody know, what is your "Application" supposed to mean.
There's no such word used anywhere in the Smarty source code.
Back to top
View user's profile Send private message
elpmis
Smarty Elite


Joined: 07 Jun 2007
Posts: 321

PostPosted: Tue Jul 12, 2016 9:17 pm    Post subject: Reply with quote

Not sure what you've done - should work

http://www.smarty.net/docs/en/api.set.plugins.dir.tpl
Back to top
View user's profile Send private message
ivica
Smarty Rookie


Joined: 11 Jul 2016
Posts: 6

PostPosted: Wed Jul 13, 2016 9:12 am    Post subject: Application::$plugins_dir has no effect Reply with quote

AnrDaemon wrote:
Nobody know, what is your "Application" supposed to mean.
There's no such word used anywhere in the Smarty source code.


My code is:
Code:
require_once SMARTY_DIR . 'Smarty.class.php';
class Application extends Smarty
{
 
  public function __construct()
  {
    parent::__construct();
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1568

PostPosted: Wed Jul 13, 2016 1:45 pm    Post subject: Reply with quote

http://lmgtfy.com/?q=composition+over+inheritance
Back to top
View user's profile Send private message
ivica
Smarty Rookie


Joined: 11 Jul 2016
Posts: 6

PostPosted: Thu Jul 14, 2016 4:11 pm    Post subject: plugins Reply with quote

Work!!! Finaly, this code work:

$this->setPluginsDir(array(
SMARTY_DIR .'plugins',
PRESENTATION_DIR . 'smarty_plugins',
));

Thanks all of you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup 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